Properly unregister from the ntfy app when the user logs out.
This commit is contained in:
parent
f406433652
commit
844e0216bd
15 changed files with 110 additions and 77 deletions
|
|
@ -8,6 +8,7 @@
|
|||
package io.element.android.libraries.pushproviders.test
|
||||
|
||||
import io.element.android.libraries.matrix.api.MatrixClient
|
||||
import io.element.android.libraries.matrix.api.core.SessionId
|
||||
import io.element.android.libraries.pushproviders.api.CurrentUserPushConfig
|
||||
import io.element.android.libraries.pushproviders.api.Distributor
|
||||
import io.element.android.libraries.pushproviders.api.PushProvider
|
||||
|
|
@ -21,6 +22,7 @@ class FakePushProvider(
|
|||
private val currentUserPushConfig: CurrentUserPushConfig? = null,
|
||||
private val registerWithResult: (MatrixClient, Distributor) -> Result<Unit> = { _, _ -> lambdaError() },
|
||||
private val unregisterWithResult: (MatrixClient) -> Result<Unit> = { lambdaError() },
|
||||
private val onSessionDeletedLambda: (SessionId) -> Unit = { lambdaError() },
|
||||
private val canRotateTokenResult: () -> Boolean = { lambdaError() },
|
||||
private val rotateTokenLambda: () -> Result<Unit> = { lambdaError() },
|
||||
) : PushProvider {
|
||||
|
|
@ -38,6 +40,10 @@ class FakePushProvider(
|
|||
return unregisterWithResult(matrixClient)
|
||||
}
|
||||
|
||||
override suspend fun onSessionDeleted(sessionId: SessionId) {
|
||||
onSessionDeletedLambda(sessionId)
|
||||
}
|
||||
|
||||
override suspend fun getCurrentUserPushConfig(): CurrentUserPushConfig? {
|
||||
return currentUserPushConfig
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue