Push distributor: ensure the current UnifiedPush distributor is stored

This commit is contained in:
Benoit Marty 2024-05-06 18:20:49 +02:00 committed by Benoit Marty
parent 56ca04affa
commit d2fbff09b8
8 changed files with 68 additions and 8 deletions

View file

@ -16,6 +16,14 @@
package io.element.android.libraries.pushproviders.api
/**
* Firebase does not have the concept of distributor. So for Firebase, there will be one distributor:
* Distributor("Firebase", "Firebase").
*
* For UnifiedPush, for instance, the Distributor can be:
* Distributor("io.heckel.ntfy", "ntfy").
* But other values are possible.
*/
data class Distributor(
val value: String,
val name: String,

View file

@ -44,6 +44,11 @@ interface PushProvider {
*/
suspend fun registerWith(matrixClient: MatrixClient, distributor: Distributor)
/**
* Return the current distributor, or null if none.
*/
suspend fun getCurrentDistributor(matrixClient: MatrixClient): Distributor?
/**
* Unregister the pusher.
*/