Fix some situations where MessageTable actions were doubled.

This commit is contained in:
Greyson Parrelli
2022-12-22 11:10:30 -05:00
parent 06b414f4ef
commit 4dd8e81db7
2 changed files with 21 additions and 59 deletions

View File

@@ -211,16 +211,8 @@ class DefaultMessageNotifier(context: Application) : MessageNotifier {
ServiceUtil.getNotificationManager(context).cancelOrphanedNotifications(context, state, stickyThreads.map { it.value.notificationId }.toSet())
updateBadge(context, state.messageCount)
val smsIds: MutableList<Long> = mutableListOf()
val mmsIds: MutableList<Long> = mutableListOf()
for (item: NotificationItem in state.notificationItems) {
if (item.isMms) {
mmsIds.add(item.id)
} else {
smsIds.add(item.id)
}
}
SignalDatabase.mmsSms.setNotifiedTimestamp(System.currentTimeMillis(), smsIds, mmsIds)
val messageIds: List<Long> = state.notificationItems.map { it.id }
SignalDatabase.mmsSms.setNotifiedTimestamp(System.currentTimeMillis(), messageIds)
Log.i(TAG, "threads: ${state.threadCount} messages: ${state.messageCount}")