Exclude visible thread from notification shown check.

fork-5.53.8
Cody Henthorne 2022-05-09 10:53:50 -04:00
rodzic 02c8656b92
commit c54c73cb48
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -224,7 +224,7 @@ class MessageNotifierV2(context: Application) : MessageNotifier {
Log.i(TAG, "threads: ${state.threadCount} messages: ${state.messageCount}")
if (Build.VERSION.SDK_INT >= 24) {
val ids = state.notificationIds + stickyThreads.map { (_, stickyThread) -> stickyThread.notificationId }
val ids = state.conversations.filter { it.threadId != visibleThread }.map { it.notificationId } + stickyThreads.map { (_, stickyThread) -> stickyThread.notificationId }
val notShown = ids - ServiceUtil.getNotificationManager(context).getDisplayedNotificationIds().getOrDefault(emptySet())
if (notShown.isNotEmpty()) {
Log.e(TAG, "Notifications should be showing but are not for ${notShown.size} threads")