From 40ed66dc5e88fb915d512b0e5ad4bf3e78df14c0 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Tue, 8 Sep 2020 10:51:45 +0200 Subject: [PATCH] document return type --- src/matrix/e2ee/megolm/Encryption.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/matrix/e2ee/megolm/Encryption.js b/src/matrix/e2ee/megolm/Encryption.js index 9849ce55..d3c613f6 100644 --- a/src/matrix/e2ee/megolm/Encryption.js +++ b/src/matrix/e2ee/megolm/Encryption.js @@ -26,6 +26,14 @@ export class Encryption { this._ownDeviceId = ownDeviceId; } + /** + * Encrypts a message with megolm + * @param {string} roomId + * @param {string} type event type to encrypt + * @param {string} content content to encrypt + * @param {object} encryptionParams the content of the m.room.encryption event + * @return {Promise} + */ async encrypt(roomId, type, content, encryptionParams) { let session = new this._olm.OutboundGroupSession(); try { @@ -145,6 +153,14 @@ export class Encryption { } } +/** + * @property {object?} roomKeyMessage if encrypting this message + * created a new outbound session, + * this contains the content of the m.room_key message + * that should be sent out over olm. + * @property {object} content the encrypted message as the content of + * the m.room.encrypted event that should be sent out + */ class EncryptionResult { constructor(content, roomKeyMessage) { this.content = content;