mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-23 09:56:00 +03:00
now that we ignore duplicated invite joined events at the source we can avoid eager notification cancels and rely on the main notification refresh flow
This commit is contained in:
parent
e95d49a3ae
commit
0c809b5ed1
1 changed files with 9 additions and 5 deletions
|
@ -212,12 +212,16 @@ class NotificationDrawerManager @Inject constructor(private val context: Context
|
|||
}
|
||||
|
||||
fun clearMemberShipNotificationForRoom(roomId: String) {
|
||||
synchronized(eventList) {
|
||||
eventList.removeAll { e ->
|
||||
e is InviteNotifiableEvent && e.roomId == roomId
|
||||
val shouldUpdate = removeAll { it is InviteNotifiableEvent && it.roomId == roomId }
|
||||
if (shouldUpdate) {
|
||||
refreshNotificationDrawerBg()
|
||||
}
|
||||
}
|
||||
notificationUtils.cancelNotificationMessage(roomId, ROOM_INVITATION_NOTIFICATION_ID)
|
||||
|
||||
private fun removeAll(predicate: (NotifiableEvent) -> Boolean): Boolean {
|
||||
return synchronized(eventList) {
|
||||
eventList.removeAll(predicate)
|
||||
}
|
||||
}
|
||||
|
||||
private var firstThrottler = FirstThrottler(200)
|
||||
|
|
Loading…
Reference in a new issue