Fix bad notification state with in-thread reaction notifications.

This commit is contained in:
Cody Henthorne
2021-04-14 13:52:34 -04:00
committed by Greyson Parrelli
parent ed8edb5aee
commit c393cd655d
2 changed files with 17 additions and 5 deletions

View File

@@ -56,6 +56,9 @@ object NotificationFactory {
if (Build.VERSION.SDK_INT >= 23 || state.conversations.size == 1) {
state.conversations.forEach { conversation ->
if (conversation.threadId == visibleThreadId && conversation.hasNewNotifications()) {
if (FeatureFlags.internalUser()) {
Log.i(TAG, "Thread is visible, notifying in thread. notificationId: ${conversation.notificationId}")
}
notifyInThread(context, conversation.recipient, lastAudibleNotification)
} else if (conversation.hasNewNotifications() || alertOverrides.contains(conversation.threadId)) {
@@ -73,7 +76,7 @@ object NotificationFactory {
}
}
if (state.conversations.size > 1 || ServiceUtil.getNotificationManager(context).isDisplayingSummaryNotification()) {
if ((state.conversations.size > 1 && threadsThatNewlyAlerted.isNotEmpty()) || ServiceUtil.getNotificationManager(context).isDisplayingSummaryNotification()) {
val builder: NotificationBuilder = NotificationBuilder.create(context)
builder.apply {