Always register the pusher when application starts

This commit is contained in:
Benoit Marty 2023-10-16 10:50:16 +02:00
parent 1895b7fc61
commit 36727f7ab7
2 changed files with 13 additions and 13 deletions

1
changelog.d/1481.bugfix Normal file
View file

@ -0,0 +1 @@
Always register the pusher when application starts

View file

@ -63,9 +63,9 @@ class PushersManager @Inject constructor(
override suspend fun registerPusher(matrixClient: MatrixClient, pushKey: String, gateway: String) {
val userDataStore = userPushStoreFactory.create(matrixClient.sessionId)
if (userDataStore.getCurrentRegisteredPushKey() == pushKey) {
Timber.tag(loggerTag.value).d("Unnecessary to register again the same pusher")
} else {
// Register the pusher to the server
Timber.tag(loggerTag.value)
.d("Unnecessary to register again the same pusher, but do it in case the pusher has been removed from the server")
}
matrixClient.pushersService().setHttpPusher(
createHttpPusher(pushKey, gateway, matrixClient.sessionId)
).fold(
@ -77,7 +77,6 @@ class PushersManager @Inject constructor(
}
)
}
}
private suspend fun createHttpPusher(
pushKey: String,