From a181b35e8db0109e613b955cf4599b9eed504bae Mon Sep 17 00:00:00 2001 From: Cody Henthorne Date: Mon, 23 Jun 2025 11:48:32 -0400 Subject: [PATCH] Remove notification state cleanup based on displayed notifications. --- .../notifications/v2/DefaultMessageNotifier.kt | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/notifications/v2/DefaultMessageNotifier.kt b/app/src/main/java/org/thoughtcrime/securesms/notifications/v2/DefaultMessageNotifier.kt index 56474dbca6..e9eb76d7a7 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/notifications/v2/DefaultMessageNotifier.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/notifications/v2/DefaultMessageNotifier.kt @@ -178,22 +178,6 @@ class DefaultMessageNotifier(context: Application) : MessageNotifier { return } - val displayedNotifications: Set? = ServiceUtil.getNotificationManager(context).getDisplayedNotificationIds().getOrNull() - if (displayedNotifications != null) { - val cleanedUpThreads: MutableSet = mutableSetOf() - state.conversations.filterNot { it.hasNewNotifications() || displayedNotifications.contains(it.notificationId) } - .forEach { conversation -> - cleanedUpThreads += conversation.thread - conversation.notificationItems.forEach { item -> - SignalDatabase.messages.markAsNotified(item.id) - } - } - if (cleanedUpThreads.isNotEmpty()) { - Log.i(TAG, "Cleaned up ${cleanedUpThreads.size} thread(s) with dangling notifications") - state = state.copy(conversations = state.conversations.filterNot { cleanedUpThreads.contains(it.thread) }) - } - } - val retainStickyThreadIds: Set = state.getThreadsWithMostRecentNotificationFromSelf() stickyThreads.keys.retainAll { retainStickyThreadIds.contains(it) }