1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-12-01 04:43:29 +03:00

Merge pull request #191 from matrix-org/rav/ciphertext_field

Use `ciphertext` instead of `body` in megolm events
This commit is contained in:
Richard van der Hoff
2016-09-06 16:25:35 +01:00
committed by GitHub

View File

@@ -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) {