Support Groups v2 Change Epochs.

This commit is contained in:
Alan Evans
2020-07-16 16:51:43 -03:00
committed by Greyson Parrelli
parent 70977e5228
commit b10fc6a0b0
6 changed files with 42 additions and 25 deletions

View File

@@ -466,7 +466,8 @@ final class GroupManagerV2 {
GroupsV2Operations.GroupOperations groupOperations = groupsV2Operations.forGroup(GroupSecretParams.deriveFromMasterKey(groupMasterKey));
try {
return groupOperations.decryptChange(GroupChange.parseFrom(signedGroupChange), true);
return groupOperations.decryptChange(GroupChange.parseFrom(signedGroupChange), true)
.orNull();
} catch (VerificationFailedException | InvalidGroupStateException | InvalidProtocolBufferException e) {
Log.w(TAG, "Unable to verify supplied group change", e);
}

View File

@@ -341,7 +341,12 @@ public final class GroupsV2StateProcessor {
}
for (DecryptedGroupHistoryEntry entry : groupStatesFromRevision) {
history.add(new ServerGroupLogEntry(entry.getGroup(), ignoreServerChanges ? null : entry.getChange()));
DecryptedGroup group = entry.getGroup().orNull();
DecryptedGroupChange change = ignoreServerChanges ? null : entry.getChange().orNull();
if (group != null || change != null) {
history.add(new ServerGroupLogEntry(group, change));
}
}
return history;