mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-22 17:35:54 +03:00
Unregister UP when signing out
This commit is contained in:
parent
905934b9d4
commit
3c72ee6e0c
1 changed files with 5 additions and 1 deletions
|
@ -18,6 +18,7 @@ package im.vector.app.core.di
|
||||||
|
|
||||||
import arrow.core.Option
|
import arrow.core.Option
|
||||||
import im.vector.app.ActiveSessionDataSource
|
import im.vector.app.ActiveSessionDataSource
|
||||||
|
import im.vector.app.core.pushers.UnifiedPushHelper
|
||||||
import im.vector.app.core.services.GuardServiceStarter
|
import im.vector.app.core.services.GuardServiceStarter
|
||||||
import im.vector.app.features.call.webrtc.WebRtcCallManager
|
import im.vector.app.features.call.webrtc.WebRtcCallManager
|
||||||
import im.vector.app.features.crypto.keysrequest.KeyRequestHandler
|
import im.vector.app.features.crypto.keysrequest.KeyRequestHandler
|
||||||
|
@ -39,6 +40,7 @@ class ActiveSessionHolder @Inject constructor(
|
||||||
private val pushRuleTriggerListener: PushRuleTriggerListener,
|
private val pushRuleTriggerListener: PushRuleTriggerListener,
|
||||||
private val sessionListener: SessionListener,
|
private val sessionListener: SessionListener,
|
||||||
private val imageManager: ImageManager,
|
private val imageManager: ImageManager,
|
||||||
|
private val unifiedPushHelper: UnifiedPushHelper,
|
||||||
private val guardServiceStarter: GuardServiceStarter
|
private val guardServiceStarter: GuardServiceStarter
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
@ -58,7 +60,7 @@ class ActiveSessionHolder @Inject constructor(
|
||||||
guardServiceStarter.start()
|
guardServiceStarter.start()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun clearActiveSession() {
|
suspend fun clearActiveSession() {
|
||||||
// Do some cleanup first
|
// Do some cleanup first
|
||||||
getSafeActiveSession()?.let {
|
getSafeActiveSession()?.let {
|
||||||
Timber.w("clearActiveSession of ${it.myUserId}")
|
Timber.w("clearActiveSession of ${it.myUserId}")
|
||||||
|
@ -72,6 +74,8 @@ class ActiveSessionHolder @Inject constructor(
|
||||||
keyRequestHandler.stop()
|
keyRequestHandler.stop()
|
||||||
incomingVerificationRequestHandler.stop()
|
incomingVerificationRequestHandler.stop()
|
||||||
pushRuleTriggerListener.stop()
|
pushRuleTriggerListener.stop()
|
||||||
|
// No need to unregister the pusher, the sign out will (should?) do it server side.
|
||||||
|
unifiedPushHelper.unregister(pushersManager = null)
|
||||||
guardServiceStarter.stop()
|
guardServiceStarter.stop()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue