mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 18:35:40 +03:00
Session.configureAndStart now handle registering to webRtcPeerConnectionManager...
This commit is contained in:
parent
10f8aebde2
commit
5f60d7fd3b
3 changed files with 14 additions and 4 deletions
|
@ -137,8 +137,12 @@ class VectorApplication :
|
|||
if (authenticationService.hasAuthenticatedSessions() && !activeSessionHolder.hasActiveSession()) {
|
||||
val lastAuthenticatedSession = authenticationService.getLastAuthenticatedSession()!!
|
||||
activeSessionHolder.setActiveSession(lastAuthenticatedSession)
|
||||
lastAuthenticatedSession.configureAndStart(applicationContext, pushRuleTriggerListener, sessionListener)
|
||||
lastAuthenticatedSession.callSignalingService().addCallListener(webRtcPeerConnectionManager)
|
||||
lastAuthenticatedSession.configureAndStart(
|
||||
applicationContext,
|
||||
pushRuleTriggerListener,
|
||||
webRtcPeerConnectionManager,
|
||||
sessionListener
|
||||
)
|
||||
}
|
||||
ProcessLifecycleOwner.get().lifecycle.addObserver(object : LifecycleObserver {
|
||||
@OnLifecycleEvent(Lifecycle.Event.ON_RESUME)
|
||||
|
|
|
@ -24,12 +24,14 @@ import im.vector.matrix.android.api.session.Session
|
|||
import im.vector.matrix.android.api.session.crypto.keysbackup.KeysBackupState
|
||||
import im.vector.matrix.android.api.session.sync.FilterService
|
||||
import im.vector.riotx.core.services.VectorSyncService
|
||||
import im.vector.riotx.features.call.WebRtcPeerConnectionManager
|
||||
import im.vector.riotx.features.notifications.PushRuleTriggerListener
|
||||
import im.vector.riotx.features.session.SessionListener
|
||||
import timber.log.Timber
|
||||
|
||||
fun Session.configureAndStart(context: Context,
|
||||
pushRuleTriggerListener: PushRuleTriggerListener,
|
||||
webRtcPeerConnectionManager: WebRtcPeerConnectionManager,
|
||||
sessionListener: SessionListener) {
|
||||
open()
|
||||
addListener(sessionListener)
|
||||
|
@ -38,6 +40,7 @@ fun Session.configureAndStart(context: Context,
|
|||
startSyncing(context)
|
||||
refreshPushers()
|
||||
pushRuleTriggerListener.startWithSession(this)
|
||||
callSignalingService().addCallListener(webRtcPeerConnectionManager)
|
||||
}
|
||||
|
||||
fun Session.startSyncing(context: Context) {
|
||||
|
|
|
@ -667,8 +667,11 @@ class LoginViewModel @AssistedInject constructor(
|
|||
|
||||
private fun onSessionCreated(session: Session) {
|
||||
activeSessionHolder.setActiveSession(session)
|
||||
session.configureAndStart(applicationContext, pushRuleTriggerListener, sessionListener)
|
||||
session.callSignalingService().addCallListener(webRtcPeerConnectionManager)
|
||||
session.configureAndStart(
|
||||
applicationContext,
|
||||
pushRuleTriggerListener,
|
||||
webRtcPeerConnectionManager,
|
||||
sessionListener)
|
||||
setState {
|
||||
copy(
|
||||
asyncLoginAction = Success(Unit)
|
||||
|
|
Loading…
Reference in a new issue