mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Apply decrypted group change when receiving signed change
This commit is contained in:
parent
c10910e466
commit
98dee97cc6
2 changed files with 51 additions and 2 deletions
|
@ -1534,8 +1534,18 @@ public class Manager implements Closeable {
|
|||
|
||||
if (groupInfoV2.getGroup() == null
|
||||
|| groupInfoV2.getGroup().getRevision() < groupContext.getRevision()) {
|
||||
// TODO check if revision is only 1 behind and a signedGroupChange is available
|
||||
groupInfoV2.setGroup(getDecryptedGroup(groupSecretParams));
|
||||
DecryptedGroup group = null;
|
||||
if (groupContext.hasSignedGroupChange()
|
||||
&& groupInfoV2.getGroup() != null
|
||||
&& groupInfoV2.getGroup().getRevision() + 1 == groupContext.getRevision()) {
|
||||
group = groupHelper.getUpdatedDecryptedGroup(groupInfoV2.getGroup(),
|
||||
groupContext.getSignedGroupChange(),
|
||||
groupMasterKey);
|
||||
}
|
||||
if (group == null) {
|
||||
group = getDecryptedGroup(groupSecretParams);
|
||||
}
|
||||
groupInfoV2.setGroup(group);
|
||||
account.getGroupStore().updateGroup(groupInfoV2);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue