fix: maybe syncing read statuses are working now

This commit is contained in:
0x330a 2023-06-28 11:07:42 +10:00
parent df39194024
commit df0bcf8bc5

View File

@ -229,8 +229,10 @@ class BatchMessageReceiveJob(
if (!openGroupID.isNullOrEmpty()) { if (!openGroupID.isNullOrEmpty()) {
Log.d("Loki-DBG", "new-lastSeen for: $openGroupID is $currentLastSeen") Log.d("Loki-DBG", "new-lastSeen for: $openGroupID is $currentLastSeen")
} }
if (newLastSeen > 0) {
storage.markConversationAsRead(threadId, newLastSeen, force = true) storage.markConversationAsRead(threadId, newLastSeen, force = true)
storage.updateThread(threadId, true) storage.updateThread(threadId, true)
}
SSKEnvironment.shared.notificationManager.updateNotification(context, threadId) SSKEnvironment.shared.notificationManager.updateNotification(context, threadId)
} }
@ -241,8 +243,10 @@ class BatchMessageReceiveJob(
} }
// await all thread processing // await all thread processing
deferredThreadMap.awaitAll() deferredThreadMap.awaitAll()
if (noThreadMessages.isNotEmpty()) {
processMessages(NO_THREAD_MAPPING, noThreadMessages).await() processMessages(NO_THREAD_MAPPING, noThreadMessages).await()
} }
}
if (failures.isEmpty()) { if (failures.isEmpty()) {
handleSuccess(dispatcherName) handleSuccess(dispatcherName)
} else { } else {