diff --git a/CHANGES.md b/CHANGES.md index b45ad9dff8..0099412196 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -9,6 +9,7 @@ Improvements 🙌: Bugfix 🐛: - Fix theme issue on Room directory screen (#1613) + - Fix notification not dismissing when entering a room Translations 🗣: - diff --git a/vector/src/main/java/im/vector/riotx/features/notifications/NotificationDrawerManager.kt b/vector/src/main/java/im/vector/riotx/features/notifications/NotificationDrawerManager.kt index d0839795dd..f7085a000e 100644 --- a/vector/src/main/java/im/vector/riotx/features/notifications/NotificationDrawerManager.kt +++ b/vector/src/main/java/im/vector/riotx/features/notifications/NotificationDrawerManager.kt @@ -155,14 +155,17 @@ class NotificationDrawerManager @Inject constructor(private val context: Context /** Clear all known message events for this room */ fun clearMessageEventOfRoom(roomId: String?) { Timber.v("clearMessageEventOfRoom $roomId") - if (roomId != null) { + var shouldUpdate = false synchronized(eventList) { - eventList.removeAll { e -> + shouldUpdate = eventList.removeAll { e -> e is NotifiableMessageEvent && e.roomId == roomId } } - refreshNotificationDrawer() + if (shouldUpdate) { + notificationUtils.cancelNotificationMessage(roomId, ROOM_MESSAGES_NOTIFICATION_ID) + refreshNotificationDrawer() + } } }