From 620fc0d2108f4284d3f4234bc47cc64b410fe3b5 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 3 Sep 2020 15:30:18 +0200 Subject: [PATCH] JSON stringify payload, olm_encrypt does not do objects --- src/matrix/e2ee/olm/Encryption.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/matrix/e2ee/olm/Encryption.js b/src/matrix/e2ee/olm/Encryption.js index c8961656..b5f3449b 100644 --- a/src/matrix/e2ee/olm/Encryption.js +++ b/src/matrix/e2ee/olm/Encryption.js @@ -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,