forked from GitHub-Mirror/riotX-android
Use Session.myUserId whereas it's possible
This commit is contained in:
@ -57,6 +57,9 @@ interface Session :
|
||||
*/
|
||||
val sessionParams: SessionParams
|
||||
|
||||
/**
|
||||
* Useful shortcut to get access to the userId
|
||||
*/
|
||||
val myUserId: String
|
||||
get() = sessionParams.credentials.userId
|
||||
|
||||
|
@ -58,7 +58,7 @@ internal class SessionManager @Inject constructor(private val matrixComponent: M
|
||||
.factory()
|
||||
.create(matrixComponent, sessionParams)
|
||||
.also {
|
||||
sessionComponents[sessionParams.credentials.userId] = it
|
||||
sessionComponents[userId] = it
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -94,11 +94,11 @@ internal class DefaultSession @Inject constructor(override val sessionParams: Se
|
||||
}
|
||||
|
||||
override fun requireBackgroundSync() {
|
||||
SyncWorker.requireBackgroundSync(context, sessionParams.credentials.userId)
|
||||
SyncWorker.requireBackgroundSync(context, myUserId)
|
||||
}
|
||||
|
||||
override fun startAutomaticBackgroundSync(repeatDelay: Long) {
|
||||
SyncWorker.automaticallyBackgroundSync(context, sessionParams.credentials.userId, 0, repeatDelay)
|
||||
SyncWorker.automaticallyBackgroundSync(context, myUserId, 0, repeatDelay)
|
||||
}
|
||||
|
||||
override fun stopAnyBackgroundSync() {
|
||||
|
Reference in New Issue
Block a user