From 717a28a446d32a581848eb1d97bc5545a6e1b4a4 Mon Sep 17 00:00:00 2001 From: Niels Andriesse Date: Fri, 9 Aug 2019 10:11:30 +1000 Subject: [PATCH] Fix missing message ID & update for core changes --- src/org/thoughtcrime/securesms/jobs/PushGroupSendJob.java | 6 ++---- src/org/thoughtcrime/securesms/loki/LokiAPIDatabase.kt | 3 ++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/org/thoughtcrime/securesms/jobs/PushGroupSendJob.java b/src/org/thoughtcrime/securesms/jobs/PushGroupSendJob.java index 74fa7fdae1..384b843711 100644 --- a/src/org/thoughtcrime/securesms/jobs/PushGroupSendJob.java +++ b/src/org/thoughtcrime/securesms/jobs/PushGroupSendJob.java @@ -255,8 +255,7 @@ public class PushGroupSendJob extends PushSendJob implements InjectableType { .asGroupMessage(group) .build(); - // TODO: Message ID - return messageSender.sendMessage(0, addresses, unidentifiedAccess, groupDataMessage); + return messageSender.sendMessage(messageId, addresses, unidentifiedAccess, groupDataMessage); } else { SignalServiceGroup group = new SignalServiceGroup(GroupUtil.getDecodedId(groupId)); SignalServiceDataMessage groupMessage = SignalServiceDataMessage.newBuilder() @@ -273,8 +272,7 @@ public class PushGroupSendJob extends PushSendJob implements InjectableType { .withPreviews(previews) .build(); - // TODO: Message ID - return messageSender.sendMessage(0, addresses, unidentifiedAccess, groupMessage); + return messageSender.sendMessage(messageId, addresses, unidentifiedAccess, groupMessage); } } diff --git a/src/org/thoughtcrime/securesms/loki/LokiAPIDatabase.kt b/src/org/thoughtcrime/securesms/loki/LokiAPIDatabase.kt index dbd7229e3f..128c107086 100644 --- a/src/org/thoughtcrime/securesms/loki/LokiAPIDatabase.kt +++ b/src/org/thoughtcrime/securesms/loki/LokiAPIDatabase.kt @@ -83,7 +83,8 @@ class LokiAPIDatabase(context: Context, helper: SQLCipherOpenHelper) : Database( return TextSecurePreferences.getProfileName(context) } - override fun setMessageID(signalID: Long, lokiID: Long) { + override fun updateMessageIDIfNeeded(signalID: Long, lokiID: Long) { + if (signalID == lokiID) return DatabaseFactory.getMmsDatabase(context).updateMessageID(signalID, lokiID) } }