add prefix to ExpirationTimerUpdateMessage for closed group too

pull/1359/head
Audric Ackermann 5 years ago
parent caa972d390
commit 53a14a0b60
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -37,9 +37,13 @@ export class ExpirationTimerUpdateMessage extends DataMessage {
if (this.groupId) {
const groupMessage = new SignalService.GroupContext();
groupMessage.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);
groupMessage.id = id;
groupMessage.type = SignalService.GroupContext.Type.DELIVER;
data.group = groupMessage;

Loading…
Cancel
Save