Skip to content

Commit

Permalink
Do not notify again for old events
Browse files Browse the repository at this point in the history
Resending the notification here can trigger other system components or
apps that listen to new notifications, such as connected smart watches
or automation tools.

Fixes element-hq#1673
  • Loading branch information
SpiritCroc committed Jul 10, 2021
1 parent 910c0ff commit 451c237
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/1673.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Avoid resending notifications that are already shown
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,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)
Expand Down

0 comments on commit 451c237

Please sign in to comment.