mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 16:10:00 +00:00
Pusher add more log and change comment to log.
This commit is contained in:
committed by
Benoit Marty
parent
148177f24e
commit
907fae10ac
@@ -55,27 +55,29 @@ class LoggedInPresenter @Inject constructor(
|
|||||||
|
|
||||||
LaunchedEffect(isVerified) {
|
LaunchedEffect(isVerified) {
|
||||||
if (isVerified) {
|
if (isVerified) {
|
||||||
// Ensure pusher is registered
|
Timber.d("Ensure pusher is registered")
|
||||||
val currentPushProvider = pushService.getCurrentPushProvider()
|
val currentPushProvider = pushService.getCurrentPushProvider()
|
||||||
val result = if (currentPushProvider == null) {
|
val result = if (currentPushProvider == null) {
|
||||||
// Register with the first available push provider
|
Timber.d("Register with the first available push provider")
|
||||||
val pushProvider = pushService.getAvailablePushProviders().firstOrNull() ?: return@LaunchedEffect
|
val pushProvider = pushService.getAvailablePushProviders().firstOrNull() ?: return@LaunchedEffect
|
||||||
val distributor = pushProvider.getDistributors().firstOrNull() ?: return@LaunchedEffect
|
val distributor = pushProvider.getDistributors().firstOrNull() ?: return@LaunchedEffect
|
||||||
pushService.registerWith(matrixClient, pushProvider, distributor)
|
pushService.registerWith(matrixClient, pushProvider, distributor)
|
||||||
} else {
|
} else {
|
||||||
val currentPushDistributor = currentPushProvider.getCurrentDistributor(matrixClient)
|
val currentPushDistributor = currentPushProvider.getCurrentDistributor(matrixClient)
|
||||||
if (currentPushDistributor == null) {
|
if (currentPushDistributor == null) {
|
||||||
// Register with the first available distributor
|
Timber.d("Register with the first available distributor")
|
||||||
val distributor = currentPushProvider.getDistributors().firstOrNull() ?: return@LaunchedEffect
|
val distributor = currentPushProvider.getDistributors().firstOrNull() ?: return@LaunchedEffect
|
||||||
pushService.registerWith(matrixClient, currentPushProvider, distributor)
|
pushService.registerWith(matrixClient, currentPushProvider, distributor)
|
||||||
} else {
|
} else {
|
||||||
// Re-register with the current distributor
|
Timber.d("Re-register with the current distributor")
|
||||||
pushService.registerWith(matrixClient, currentPushProvider, currentPushDistributor)
|
pushService.registerWith(matrixClient, currentPushProvider, currentPushDistributor)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result.onFailure {
|
result.onFailure {
|
||||||
Timber.e(it, "Failed to register pusher")
|
Timber.e(it, "Failed to register pusher")
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
Timber.w("Session is not verified, not registering pusher")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user