relying on the notification refreshing to cancel/update the notifications

This commit is contained in:
Adam Brown 2021-10-11 09:55:26 +01:00
parent 03fe45da60
commit 587466e009
1 changed files with 1 additions and 7 deletions

View File

@ -165,14 +165,8 @@ class NotificationDrawerManager @Inject constructor(private val context: Context
fun clearMessageEventOfRoom(roomId: String?) {
Timber.v("clearMessageEventOfRoom $roomId")
if (roomId != null) {
var shouldUpdate = false
synchronized(eventList) {
shouldUpdate = eventList.removeAll { e ->
e is NotifiableMessageEvent && e.roomId == roomId
}
}
val shouldUpdate = removeAll { it is NotifiableMessageEvent && it.roomId == roomId }
if (shouldUpdate) {
notificationUtils.cancelNotificationMessage(roomId, ROOM_MESSAGES_NOTIFICATION_ID)
refreshNotificationDrawer()
}
}