From e32736359ba910eb9bd0b6bd200d3b0866238094 Mon Sep 17 00:00:00 2001 From: Moxie Marlinspike Date: Thu, 10 Dec 2015 04:34:20 -0800 Subject: [PATCH] Move group message to group after accepting new identity key Fixes #2739 // FREEBIE --- src/org/thoughtcrime/securesms/jobs/PushDecryptJob.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/org/thoughtcrime/securesms/jobs/PushDecryptJob.java b/src/org/thoughtcrime/securesms/jobs/PushDecryptJob.java index bd5981d6af..33c3c5012f 100644 --- a/src/org/thoughtcrime/securesms/jobs/PushDecryptJob.java +++ b/src/org/thoughtcrime/securesms/jobs/PushDecryptJob.java @@ -326,7 +326,7 @@ public class PushDecryptJob extends ContextJob { Pair messageAndThreadId; - if (smsMessageId.isPresent()) { + if (smsMessageId.isPresent() && !message.getGroupInfo().isPresent()) { messageAndThreadId = database.updateBundleMessageBody(masterSecret, smsMessageId.get(), body); } else { IncomingTextMessage textMessage = new IncomingTextMessage(envelope.getSource(), @@ -336,6 +336,8 @@ public class PushDecryptJob extends ContextJob { textMessage = new IncomingEncryptedMessage(textMessage, body); messageAndThreadId = database.insertMessageInbox(masterSecret, textMessage); + + if (smsMessageId.isPresent()) database.deleteMessage(smsMessageId.get()); } MessageNotifier.updateNotification(context, masterSecret.getMasterSecret().orNull(), messageAndThreadId.second);