Insert resent messages at the proper location.

This commit is contained in:
Greyson Parrelli
2021-06-29 15:13:31 -04:00
committed by Alex Hart
parent 90a27d2227
commit a1c8573fad
20 changed files with 306 additions and 168 deletions

View File

@@ -248,7 +248,7 @@ public final class GroupV1MessageProcessor {
} else {
MessageDatabase smsDatabase = DatabaseFactory.getSmsDatabase(context);
String body = Base64.encodeBytes(storage.toByteArray());
IncomingTextMessage incoming = new IncomingTextMessage(Recipient.externalHighTrustPush(context, content.getSender()).getId(), content.getSenderDevice(), content.getTimestamp(), content.getServerReceivedTimestamp(), body, Optional.of(GroupId.v1orThrow(group.getGroupId())), 0, content.isNeedsReceipt(), content.getServerUuid());
IncomingTextMessage incoming = new IncomingTextMessage(Recipient.externalHighTrustPush(context, content.getSender()).getId(), content.getSenderDevice(), content.getTimestamp(), content.getServerReceivedTimestamp(), System.currentTimeMillis(), body, Optional.of(GroupId.v1orThrow(group.getGroupId())), 0, content.isNeedsReceipt(), content.getServerUuid());
IncomingGroupUpdateMessage groupMessage = new IncomingGroupUpdateMessage(incoming, storage, body);
Optional<InsertResult> insertResult = smsDatabase.insertMessageInbox(groupMessage);

View File

@@ -521,7 +521,7 @@ public final class GroupsV2StateProcessor {
} else {
MessageDatabase smsDatabase = DatabaseFactory.getSmsDatabase(context);
RecipientId sender = RecipientId.from(editor.get(), null);
IncomingTextMessage incoming = new IncomingTextMessage(sender, -1, timestamp, timestamp, "", Optional.of(groupId), 0, false, null);
IncomingTextMessage incoming = new IncomingTextMessage(sender, -1, timestamp, timestamp, timestamp, "", Optional.of(groupId), 0, false, null);
IncomingGroupUpdateMessage groupMessage = new IncomingGroupUpdateMessage(incoming, decryptedGroupV2Context);
if (!smsDatabase.insertMessageInbox(groupMessage).isPresent()) {