mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:55:41 +00:00
Add logs on pusher registration
This commit is contained in:
+4
-1
@@ -51,13 +51,16 @@ class DefaultPushService @Inject constructor(
|
|||||||
pushProvider: PushProvider,
|
pushProvider: PushProvider,
|
||||||
distributor: Distributor,
|
distributor: Distributor,
|
||||||
): Result<Unit> {
|
): Result<Unit> {
|
||||||
|
Timber.d("Registering with ${pushProvider.name}/${distributor.name}}")
|
||||||
val userPushStore = userPushStoreFactory.getOrCreate(matrixClient.sessionId)
|
val userPushStore = userPushStoreFactory.getOrCreate(matrixClient.sessionId)
|
||||||
val currentPushProviderName = userPushStore.getPushProviderName()
|
val currentPushProviderName = userPushStore.getPushProviderName()
|
||||||
val currentPushProvider = pushProviders.find { it.name == currentPushProviderName }
|
val currentPushProvider = pushProviders.find { it.name == currentPushProviderName }
|
||||||
val currentDistributorValue = currentPushProvider?.getCurrentDistributor(matrixClient)?.value
|
val currentDistributorValue = currentPushProvider?.getCurrentDistributor(matrixClient)?.value
|
||||||
if (currentPushProviderName != pushProvider.name || currentDistributorValue != distributor.value) {
|
if (currentPushProviderName != pushProvider.name || currentDistributorValue != distributor.value) {
|
||||||
// Unregister previous one if any
|
// Unregister previous one if any
|
||||||
currentPushProvider?.unregister(matrixClient)
|
currentPushProvider
|
||||||
|
?.also { Timber.d("Unregistering previous push provider $currentPushProviderName/$currentDistributorValue") }
|
||||||
|
?.unregister(matrixClient)
|
||||||
?.onFailure {
|
?.onFailure {
|
||||||
Timber.w(it, "Failed to unregister previous push provider")
|
Timber.w(it, "Failed to unregister previous push provider")
|
||||||
return Result.failure(it)
|
return Result.failure(it)
|
||||||
|
|||||||
Reference in New Issue
Block a user