mirror of
https://github.com/element-hq/element-android
synced 2024-11-27 11:59:12 +03:00
Feature/fix notification clearing (#1707)
Updating notification when entering a room
This commit is contained in:
parent
44fb53ce6b
commit
6e0095edb0
2 changed files with 7 additions and 3 deletions
|
@ -9,6 +9,7 @@ Improvements 🙌:
|
|||
|
||||
Bugfix 🐛:
|
||||
- Fix theme issue on Room directory screen (#1613)
|
||||
- Fix notification not dismissing when entering a room
|
||||
|
||||
Translations 🗣:
|
||||
-
|
||||
|
|
|
@ -155,16 +155,19 @@ 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
|
||||
}
|
||||
}
|
||||
if (shouldUpdate) {
|
||||
notificationUtils.cancelNotificationMessage(roomId, ROOM_MESSAGES_NOTIFICATION_ID)
|
||||
refreshNotificationDrawer()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Should be called when the application is currently opened and showing timeline for the given roomId.
|
||||
|
|
Loading…
Reference in a new issue