From 98dc5328a05f19dc68e9bc8810cc46eb4b5feab1 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Tue, 6 Sep 2016 16:23:23 +0100 Subject: [PATCH] Use `ciphertext` instead of `body` in megolm events Apparently `body` is going to be special. --- lib/crypto-algorithms/megolm.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/crypto-algorithms/megolm.js b/lib/crypto-algorithms/megolm.js index d54a442e6..5b27025a5 100644 --- a/lib/crypto-algorithms/megolm.js +++ b/lib/crypto-algorithms/megolm.js @@ -182,7 +182,7 @@ MegolmEncryption.prototype.encryptMessage = function(room, eventType, content) { var encryptedContent = { algorithm: olmlib.MEGOLM_ALGORITHM, sender_key: self._olmDevice.deviceCurve25519Key, - body: ciphertext, + ciphertext: ciphertext, session_id: session_id, }; @@ -251,14 +251,14 @@ MegolmDecryption.prototype.decryptEvent = function(event) { content.session_id); if (!content.sender_key || !content.session_id || - !content.body + !content.ciphertext ) { throw new base.DecryptionError("Missing fields in input"); } try { var res = this._olmDevice.decryptGroupMessage( - event.room_id, content.sender_key, content.session_id, content.body + event.room_id, content.sender_key, content.session_id, content.ciphertext ); return JSON.parse(res); } catch (e) {