mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
Try to centralise session restoration through MatrixClientsHolder
This commit is contained in:
+3
-3
@@ -257,11 +257,11 @@ class DefaultNotificationDrawerManager @Inject constructor(
|
||||
val currentUser = tryOrNull(
|
||||
onError = { Timber.e(it, "Unable to retrieve info for user ${sessionId.value}") },
|
||||
operation = {
|
||||
val client = matrixClientsHolder.getOrNull(sessionId)
|
||||
val client = matrixClientsHolder.requireSession(sessionId)
|
||||
|
||||
// myUserDisplayName cannot be empty else NotificationCompat.MessagingStyle() will crash
|
||||
val myUserDisplayName = client?.loadUserDisplayName()?.getOrNull() ?: sessionId.value
|
||||
val userAvatarUrl = client?.loadUserAvatarURLString()?.getOrNull()
|
||||
val myUserDisplayName = client.loadUserDisplayName().getOrNull() ?: sessionId.value
|
||||
val userAvatarUrl = client.loadUserAvatarURLString().getOrNull()
|
||||
MatrixUser(
|
||||
userId = sessionId,
|
||||
displayName = myUserDisplayName,
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ class NotifiableEventResolver @Inject constructor(
|
||||
|
||||
suspend fun resolveEvent(sessionId: SessionId, roomId: RoomId, eventId: EventId): NotifiableEvent? {
|
||||
// Restore session
|
||||
val client = matrixClientsHolder.getOrNull(sessionId) ?: return null
|
||||
val client = matrixClientsHolder.requireSession(sessionId)
|
||||
val notificationService = client.notificationService()
|
||||
val notificationData = notificationService.getNotification(
|
||||
userId = sessionId,
|
||||
|
||||
Reference in New Issue
Block a user