From 6b7564f9f44a69e1f20482754ff82bf3d3b098e8 Mon Sep 17 00:00:00 2001 From: SpiritCroc Date: Fri, 28 May 2021 15:16:04 +0200 Subject: [PATCH] Do not notify again for old events Resending the notification here can trigger other system components or apps that listen to new notifications, such as connected smart watches or automation tools. Hopefully fixes https://github.com/SchildiChat/SchildiChat-android/issues/11 Change-Id: I9fe77f8d32c802a14439179b054727733bbe1cf8 --- .../app/features/notifications/NotificationDrawerManager.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vector/src/main/java/im/vector/app/features/notifications/NotificationDrawerManager.kt b/vector/src/main/java/im/vector/app/features/notifications/NotificationDrawerManager.kt index b68f0422dd..f081fd85ff 100644 --- a/vector/src/main/java/im/vector/app/features/notifications/NotificationDrawerManager.kt +++ b/vector/src/main/java/im/vector/app/features/notifications/NotificationDrawerManager.kt @@ -466,7 +466,7 @@ class NotificationDrawerManager @Inject constructor(private val context: Context if (eventList.isEmpty() || eventList.all { it.isRedacted }) { notificationUtils.cancelNotificationMessage(null, SUMMARY_NOTIFICATION_ID) - } else { + } else if (hasNewEvent) { // FIXME roomIdToEventMap.size is not correct, this is the number of rooms val nbEvents = roomIdToEventMap.size + simpleEvents.size val sumTitle = stringProvider.getQuantityString(R.plurals.notification_compat_summary_title, nbEvents, nbEvents)