mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-04 20:01:55 +00:00
Notification: fix issue: clear event only for the matching session.
We do not have multi session so the bug is not visible yet.
This commit is contained in:
+2
-2
@@ -195,9 +195,9 @@ class DefaultNotificationDrawerManager @Inject constructor(
|
|||||||
/**
|
/**
|
||||||
* Clear the notifications for a single event.
|
* Clear the notifications for a single event.
|
||||||
*/
|
*/
|
||||||
fun clearEvent(eventId: EventId, doRender: Boolean) {
|
fun clearEvent(sessionId: SessionId, eventId: EventId, doRender: Boolean) {
|
||||||
updateEvents(doRender = doRender) {
|
updateEvents(doRender = doRender) {
|
||||||
it.clearEvent(eventId)
|
it.clearEvent(sessionId, eventId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -56,7 +56,7 @@ class NotificationBroadcastReceiver : BroadcastReceiver() {
|
|||||||
defaultNotificationDrawerManager.clearMembershipNotificationForRoom(sessionId, roomId, doRender = false)
|
defaultNotificationDrawerManager.clearMembershipNotificationForRoom(sessionId, roomId, doRender = false)
|
||||||
}
|
}
|
||||||
actionIds.dismissEvent -> if (eventId != null) {
|
actionIds.dismissEvent -> if (eventId != null) {
|
||||||
defaultNotificationDrawerManager.clearEvent(eventId, doRender = false)
|
defaultNotificationDrawerManager.clearEvent(sessionId, eventId, doRender = false)
|
||||||
}
|
}
|
||||||
actionIds.markRoomRead -> if (roomId != null) {
|
actionIds.markRoomRead -> if (roomId != null) {
|
||||||
defaultNotificationDrawerManager.clearMessagesForRoom(sessionId, roomId, doRender = true)
|
defaultNotificationDrawerManager.clearMessagesForRoom(sessionId, roomId, doRender = true)
|
||||||
|
|||||||
+2
-2
@@ -135,8 +135,8 @@ data class NotificationEventQueue constructor(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun clearEvent(eventId: EventId) {
|
fun clearEvent(sessionId: SessionId, eventId: EventId) {
|
||||||
queue.removeAll { it.eventId == eventId }
|
queue.removeAll { it.sessionId == sessionId && it.eventId == eventId }
|
||||||
}
|
}
|
||||||
|
|
||||||
fun clearMembershipNotificationForSession(sessionId: SessionId) {
|
fun clearMembershipNotificationForSession(sessionId: SessionId) {
|
||||||
|
|||||||
Reference in New Issue
Block a user