Adds announcement group change decryption
This commit is contained in:
parent
830c8dd004
commit
8bcf3addc7
1 changed files with 25 additions and 1 deletions
26
ts/groups.ts
26
ts/groups.ts
|
@ -3897,7 +3897,7 @@ function extractDiffs({
|
|||
|
||||
// announcementsOnly
|
||||
|
||||
if (old.announcementsOnly !== current.announcementsOnly) {
|
||||
if (Boolean(old.announcementsOnly) !== Boolean(current.announcementsOnly)) {
|
||||
details.push({
|
||||
type: 'announcements-only',
|
||||
announcementsOnly: Boolean(current.announcementsOnly),
|
||||
|
@ -4525,6 +4525,11 @@ async function applyGroupChange({
|
|||
}
|
||||
}
|
||||
|
||||
if (actions.modifyAnnouncementsOnly) {
|
||||
const { announcementsOnly } = actions.modifyAnnouncementsOnly;
|
||||
result.announcementsOnly = announcementsOnly;
|
||||
}
|
||||
|
||||
if (ourConversationId) {
|
||||
result.left = !members[ourConversationId];
|
||||
}
|
||||
|
@ -4810,6 +4815,9 @@ async function applyGroupState({
|
|||
result.description = undefined;
|
||||
}
|
||||
|
||||
// announcementsOnly
|
||||
result.announcementsOnly = groupState.announcementsOnly;
|
||||
|
||||
return {
|
||||
newAttributes: result,
|
||||
newProfileKeys,
|
||||
|
@ -4916,6 +4924,9 @@ type DecryptedGroupChangeActions = {
|
|||
modifyDescription?: {
|
||||
descriptionBytes?: Proto.GroupAttributeBlob;
|
||||
};
|
||||
modifyAnnouncementsOnly?: {
|
||||
announcementsOnly: boolean;
|
||||
};
|
||||
} & Pick<
|
||||
Proto.GroupChange.IActions,
|
||||
| 'modifyAttributesAccess'
|
||||
|
@ -5433,6 +5444,14 @@ function decryptGroupChange(
|
|||
}
|
||||
}
|
||||
|
||||
// modifyAnnouncementsOnly
|
||||
if (actions.modifyAnnouncementsOnly) {
|
||||
const { announcementsOnly } = actions.modifyAnnouncementsOnly;
|
||||
result.modifyAnnouncementsOnly = {
|
||||
announcementsOnly: Boolean(announcementsOnly),
|
||||
};
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -5490,6 +5509,7 @@ type DecryptedGroupState = {
|
|||
inviteLinkPassword?: string;
|
||||
descriptionBytes?: Proto.GroupAttributeBlob;
|
||||
avatar?: string;
|
||||
announcementsOnly?: boolean;
|
||||
};
|
||||
|
||||
function decryptGroupState(
|
||||
|
@ -5621,6 +5641,10 @@ function decryptGroupState(
|
|||
}
|
||||
}
|
||||
|
||||
// announcementsOnly
|
||||
const { announcementsOnly } = groupState;
|
||||
result.announcementsOnly = Boolean(announcementsOnly);
|
||||
|
||||
result.avatar = dropNull(groupState.avatar);
|
||||
|
||||
return result;
|
||||
|
|
Loading…
Reference in a new issue