Pusher add more log and change comment to log.
This commit is contained in:
parent
da8285b10e
commit
209d4f8fe0
1 changed files with 6 additions and 4 deletions
|
|
@ -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")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue