|
|
@ -21,6 +21,7 @@ import { StringUtils } from '../session/utils';
|
|
|
|
import { UserUtil } from '../util';
|
|
|
|
import { UserUtil } from '../util';
|
|
|
|
|
|
|
|
|
|
|
|
export async function handleContentMessage(envelope: EnvelopePlus) {
|
|
|
|
export async function handleContentMessage(envelope: EnvelopePlus) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
const plaintext = await decrypt(envelope, envelope.content);
|
|
|
|
const plaintext = await decrypt(envelope, envelope.content);
|
|
|
|
|
|
|
|
|
|
|
|
if (!plaintext) {
|
|
|
|
if (!plaintext) {
|
|
|
@ -30,6 +31,9 @@ export async function handleContentMessage(envelope: EnvelopePlus) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
await innerHandleContentMessage(envelope, plaintext);
|
|
|
|
await innerHandleContentMessage(envelope, plaintext);
|
|
|
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
|
|
window.log.warn(e);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
async function decryptForMediumGroup(
|
|
|
|
async function decryptForMediumGroup(
|
|
|
@ -86,7 +90,7 @@ async function decryptForMediumGroup(
|
|
|
|
sourceAsStr
|
|
|
|
sourceAsStr
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
return plaintext;
|
|
|
|
return unpad(plaintext);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function unpad(paddedData: ArrayBuffer): ArrayBuffer {
|
|
|
|
function unpad(paddedData: ArrayBuffer): ArrayBuffer {
|
|
|
|