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 🐛:
|
Bugfix 🐛:
|
||||||
- Fix theme issue on Room directory screen (#1613)
|
- Fix theme issue on Room directory screen (#1613)
|
||||||
|
- Fix notification not dismissing when entering a room
|
||||||
|
|
||||||
Translations 🗣:
|
Translations 🗣:
|
||||||
-
|
-
|
||||||
|
|
|
@ -155,14 +155,17 @@ class NotificationDrawerManager @Inject constructor(private val context: Context
|
||||||
/** Clear all known message events for this room */
|
/** Clear all known message events for this room */
|
||||||
fun clearMessageEventOfRoom(roomId: String?) {
|
fun clearMessageEventOfRoom(roomId: String?) {
|
||||||
Timber.v("clearMessageEventOfRoom $roomId")
|
Timber.v("clearMessageEventOfRoom $roomId")
|
||||||
|
|
||||||
if (roomId != null) {
|
if (roomId != null) {
|
||||||
|
var shouldUpdate = false
|
||||||
synchronized(eventList) {
|
synchronized(eventList) {
|
||||||
eventList.removeAll { e ->
|
shouldUpdate = eventList.removeAll { e ->
|
||||||
e is NotifiableMessageEvent && e.roomId == roomId
|
e is NotifiableMessageEvent && e.roomId == roomId
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
refreshNotificationDrawer()
|
if (shouldUpdate) {
|
||||||
|
notificationUtils.cancelNotificationMessage(roomId, ROOM_MESSAGES_NOTIFICATION_ID)
|
||||||
|
refreshNotificationDrawer()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue