Move group message to group after accepting new identity key

Fixes #2739
// FREEBIE
This commit is contained in:
Moxie Marlinspike 2015-12-10 04:34:20 -08:00
parent 3efcb5dfa1
commit e32736359b

View File

@ -326,7 +326,7 @@ public class PushDecryptJob extends ContextJob {
Pair<Long, Long> 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);