From df0bcf8bc5de62a9cc64dc1b01b5f35dff97398d Mon Sep 17 00:00:00 2001 From: 0x330a <92654767+0x330a@users.noreply.github.com> Date: Wed, 28 Jun 2023 11:07:42 +1000 Subject: [PATCH] fix: maybe syncing read statuses are working now --- .../messaging/jobs/BatchMessageReceiveJob.kt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libsession/src/main/java/org/session/libsession/messaging/jobs/BatchMessageReceiveJob.kt b/libsession/src/main/java/org/session/libsession/messaging/jobs/BatchMessageReceiveJob.kt index d1d5989df4..2d471c5b2d 100644 --- a/libsession/src/main/java/org/session/libsession/messaging/jobs/BatchMessageReceiveJob.kt +++ b/libsession/src/main/java/org/session/libsession/messaging/jobs/BatchMessageReceiveJob.kt @@ -229,8 +229,10 @@ class BatchMessageReceiveJob( if (!openGroupID.isNullOrEmpty()) { Log.d("Loki-DBG", "new-lastSeen for: $openGroupID is $currentLastSeen") } - storage.markConversationAsRead(threadId, newLastSeen, force = true) - storage.updateThread(threadId, true) + if (newLastSeen > 0) { + storage.markConversationAsRead(threadId, newLastSeen, force = true) + storage.updateThread(threadId, true) + } SSKEnvironment.shared.notificationManager.updateNotification(context, threadId) } @@ -241,7 +243,9 @@ class BatchMessageReceiveJob( } // await all thread processing deferredThreadMap.awaitAll() - processMessages(NO_THREAD_MAPPING, noThreadMessages).await() + if (noThreadMessages.isNotEmpty()) { + processMessages(NO_THREAD_MAPPING, noThreadMessages).await() + } } if (failures.isEmpty()) { handleSuccess(dispatcherName)