JSON stringify payload, olm_encrypt does not do objects

This commit is contained in:
Bruno Windels 2020-09-03 15:30:18 +02:00
parent 8676909a26
commit 620fc0d210

View file

@ -107,7 +107,8 @@ export class Encryption {
_encryptForDevice(type, content, target) {
const {session, device} = target;
const message = session.encrypt(this._buildPlainTextMessageForDevice(type, content, device));
const plaintext = JSON.stringify(this._buildPlainTextMessageForDevice(type, content, device));
const message = session.encrypt(plaintext);
const encryptedContent = {
algorithm: OLM_ALGORITHM,
sender_key: this._account.identityKeys.curve25519,