mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:55:41 +00:00
UnifiedPush: also invoke UnifiedPush.unregisterApp when endpoint == null || gateway == null
This commit is contained in:
committed by
Benoit Marty
parent
9f5a8a3497
commit
022cd93653
+8
-5
@@ -33,15 +33,18 @@ class DefaultUnregisterUnifiedPushUseCase @Inject constructor(
|
|||||||
if (endpoint == null || gateway == null) {
|
if (endpoint == null || gateway == null) {
|
||||||
Timber.w("No endpoint or gateway found for client secret")
|
Timber.w("No endpoint or gateway found for client secret")
|
||||||
// Ensure we don't have any remaining data, but ignore this error
|
// Ensure we don't have any remaining data, but ignore this error
|
||||||
unifiedPushStore.storeUpEndpoint(clientSecret, null)
|
cleanup(clientSecret)
|
||||||
unifiedPushStore.storePushGateway(clientSecret, null)
|
|
||||||
return Result.success(Unit)
|
return Result.success(Unit)
|
||||||
}
|
}
|
||||||
return pusherSubscriber.unregisterPusher(matrixClient, endpoint, gateway)
|
return pusherSubscriber.unregisterPusher(matrixClient, endpoint, gateway)
|
||||||
.onSuccess {
|
.onSuccess {
|
||||||
unifiedPushStore.storeUpEndpoint(clientSecret, null)
|
cleanup(clientSecret)
|
||||||
unifiedPushStore.storePushGateway(clientSecret, null)
|
|
||||||
UnifiedPush.unregisterApp(context, clientSecret)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun cleanup(clientSecret: String) {
|
||||||
|
unifiedPushStore.storeUpEndpoint(clientSecret, null)
|
||||||
|
unifiedPushStore.storePushGateway(clientSecret, null)
|
||||||
|
UnifiedPush.unregisterApp(context, clientSecret)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user