Fix merge

This commit is contained in:
Niels Andriesse
2021-05-24 16:21:24 +10:00
parent ba116df195
commit 5d9957a57d
5 changed files with 9 additions and 12 deletions

View File

@@ -188,7 +188,7 @@ class Storage(context: Context, helper: SQLCipherOpenHelper) : Database(context,
return DatabaseFactory.getSessionJobDatabase(context).getMessageSendJob(messageSendJobID)
}
override fun getMessageReceivedJob(messageReceiveJobID: String): MessageReceiveJob? {
override fun getMessageReceiveJob(messageReceiveJobID: String): MessageReceiveJob? {
return DatabaseFactory.getSessionJobDatabase(context).getMessageReceiveJob(messageReceiveJobID)
}

View File

@@ -23,13 +23,13 @@ object OpenGroupManager {
val isAllCaughtUp: Boolean
get() {
pollers.values.forEach { poller ->
val jobID = poller.secondLastJob?.id
val jobID = poller.secondToLastJob?.id
jobID?.let {
val storage = MessagingModuleConfiguration.shared.storage
if (storage.getMessageReceivedJob(jobID) == null) {
// If the second last job is done, it means we are now handling the last job
if (storage.getMessageReceiveJob(jobID) == null) {
// If the second to last job is done, it means we are now handling the last job
poller.isCaughtUp = true
poller.secondLastJob = null
poller.secondToLastJob = null
}
}
if (!poller.isCaughtUp) { return false }

View File

@@ -67,8 +67,6 @@ public class OptimizedMessageNotifier implements MessageNotifier {
}
isCaughtUp = isCaughtUp && OpenGroupManager.INSTANCE.isAllCaughtUp();
Log.d("Ryan", "Is caught up? " + isCaughtUp);
if (isCaughtUp) {
performOnBackgroundThreadIfNeeded(() -> wrapped.updateNotification(context, threadId));