Close MatrixClient after usage
This commit is contained in:
parent
6ecbe1f856
commit
9fe42691ea
2 changed files with 10 additions and 9 deletions
|
|
@ -77,10 +77,9 @@ class PushersManager @Inject constructor(
|
|||
sessionStore.getAllSessions().toUserList().forEach { userId ->
|
||||
val userDataStore = userPushStoreFactory.create(userId)
|
||||
if (userDataStore.isFirebase()) {
|
||||
val client = matrixAuthenticationService.restoreSession(SessionId(userId)).getOrNull()
|
||||
client ?: return@forEach
|
||||
registerPusher(client, firebaseToken, PushConfig.pusher_http_url)
|
||||
// TODO EAx Close sessions
|
||||
matrixAuthenticationService.restoreSession(SessionId(userId)).getOrNull()?.use { client ->
|
||||
registerPusher(client, firebaseToken, PushConfig.pusher_http_url)
|
||||
}
|
||||
} else {
|
||||
Timber.d("This session is not using Firebase pusher")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,11 +141,13 @@ class PushHandler @Inject constructor(
|
|||
// Restore session
|
||||
val session = matrixAuthenticationService.restoreSession(SessionId(userId)).getOrNull() ?: return
|
||||
// TODO EAx, no need for a session?
|
||||
val notificationData = session.notificationService().getNotification(
|
||||
userId = userId,
|
||||
roomId = pushData.roomId,
|
||||
eventId = pushData.eventId,
|
||||
)
|
||||
val notificationData = session.use {
|
||||
it.notificationService().getNotification(
|
||||
userId = userId,
|
||||
roomId = pushData.roomId,
|
||||
eventId = pushData.eventId,
|
||||
)
|
||||
}
|
||||
|
||||
// TODO Remove
|
||||
Timber.w("Notification: $notificationData")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue