Add exhaustive UUIDKind checks to MessageReceiver
This commit is contained in:
parent
c6ee6a038e
commit
5076972c5b
1 changed files with 7 additions and 0 deletions
|
@ -1070,6 +1070,8 @@ export default class MessageReceiver
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
strictAssert(uuidKind === UUIDKind.ACI, 'Sealed non-ACI envelope');
|
||||||
|
|
||||||
const ciphertext = envelope.content || envelope.legacyMessage;
|
const ciphertext = envelope.content || envelope.legacyMessage;
|
||||||
if (!ciphertext) {
|
if (!ciphertext) {
|
||||||
this.removeFromCache(envelope);
|
this.removeFromCache(envelope);
|
||||||
|
@ -1441,6 +1443,11 @@ export default class MessageReceiver
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
strictAssert(
|
||||||
|
uuidKind === UUIDKind.PNI || uuidKind === UUIDKind.ACI,
|
||||||
|
`Unsupported uuidKind: ${uuidKind}`
|
||||||
|
);
|
||||||
|
|
||||||
if (envelope.type === envelopeTypeEnum.PLAINTEXT_CONTENT) {
|
if (envelope.type === envelopeTypeEnum.PLAINTEXT_CONTENT) {
|
||||||
log.info(`decrypt/${logId}: plaintext message`);
|
log.info(`decrypt/${logId}: plaintext message`);
|
||||||
const buffer = Buffer.from(ciphertext);
|
const buffer = Buffer.from(ciphertext);
|
||||||
|
|
Loading…
Add table
Reference in a new issue