mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 20:26:24 +00:00
Fix group state decoding for default values
This commit is contained in:
17
ts/groups.ts
17
ts/groups.ts
@@ -6603,9 +6603,13 @@ function decryptGroupState(
|
||||
const { accessControl } = groupState;
|
||||
strictAssert(accessControl, 'No accessControl field found');
|
||||
|
||||
const attributes = dropNull(accessControl.attributes);
|
||||
const members = dropNull(accessControl.members);
|
||||
const addFromInviteLink = dropNull(accessControl.addFromInviteLink);
|
||||
const attributes =
|
||||
accessControl.attributes ?? Proto.AccessControl.AccessRequired.UNKNOWN;
|
||||
const members =
|
||||
accessControl.members ?? Proto.AccessControl.AccessRequired.UNKNOWN;
|
||||
const addFromInviteLink =
|
||||
accessControl.addFromInviteLink ??
|
||||
Proto.AccessControl.AccessRequired.UNKNOWN;
|
||||
|
||||
strictAssert(
|
||||
isValidAccess(attributes),
|
||||
@@ -6628,11 +6632,12 @@ function decryptGroupState(
|
||||
}
|
||||
|
||||
// version
|
||||
const version = groupState.version ?? 0;
|
||||
strictAssert(
|
||||
isNumber(groupState.version),
|
||||
`decryptGroupState: Expected version to be a number; it was ${groupState.version}`
|
||||
isNumber(version),
|
||||
`decryptGroupState: Expected version to be a number or null; it was ${groupState.version}`
|
||||
);
|
||||
result.version = groupState.version;
|
||||
result.version = version;
|
||||
|
||||
// members
|
||||
if (groupState.members) {
|
||||
|
||||
Reference in New Issue
Block a user