fix pubkey regex for mobile medium groups

pull/1344/head
Audric Ackermann 5 years ago
parent 215c964fab
commit 514eb9ba98
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -80,7 +80,7 @@ async function decryptForMediumGroup(
window.console.info(
'Dropping message from ourself after decryptForMediumGroup'
);
return;
return null;
}
const plaintext = await decryptWithSenderKey(

@ -32,7 +32,12 @@ export abstract class ClosedGroupMessage extends DataMessage {
}
protected groupContext(): SignalService.GroupContext {
const id = new Uint8Array(StringUtils.encode(this.groupId.key, 'utf8'));
let groupIdWithPrefix: string = this.groupId.key;
if (!this.groupId.key.startsWith(PubKey.PREFIX_GROUP_TEXTSECURE)) {
groupIdWithPrefix = PubKey.PREFIX_GROUP_TEXTSECURE + this.groupId.key;
}
const encoded = StringUtils.encode(groupIdWithPrefix, 'utf8');
const id = new Uint8Array(encoded);
return new SignalService.GroupContext({ id });
}

@ -8,7 +8,6 @@ export class PubKey {
// tslint:disable: member-ordering
public static readonly regexForPubkeys = `((05)?${PubKey.HEX}{64})`;
public static readonly PREFIX_GROUP_TEXTSECURE = '__textsecure_group__!';
// prettier-ignore
private static readonly regex: RegExp = new RegExp(
`^(${PubKey.PREFIX_GROUP_TEXTSECURE})?(05)?(${PubKey.HEX}{64}|${PubKey.HEX}{32})$`

Loading…
Cancel
Save