You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-28 05:03:59 +03:00
Make encryption asynchronous
We're going to need to send out a load of messages to distribute the megolm keys; as a first step, deal with the asynchronicity this will require.
This commit is contained in:
@@ -20,6 +20,7 @@ limitations under the License.
|
||||
*
|
||||
* @module crypto-algorithms/olm
|
||||
*/
|
||||
var q = require('q');
|
||||
|
||||
var utils = require("../utils");
|
||||
|
||||
@@ -60,7 +61,7 @@ OlmEncryption.prototype.initRoomEncryption = function(roomMembers) {
|
||||
* @param {string} eventType
|
||||
* @param {object} plaintext event content
|
||||
*
|
||||
* @return {object} new event body
|
||||
* @return {module:client.Promise} Promise which resolves to the new event body
|
||||
*/
|
||||
OlmEncryption.prototype.encryptMessage = function(room, eventType, content) {
|
||||
if (!room) {
|
||||
@@ -128,7 +129,7 @@ OlmEncryption.prototype.encryptMessage = function(room, eventType, content) {
|
||||
sender_key: this._olmDevice.deviceCurve25519Key,
|
||||
ciphertext: ciphertext
|
||||
};
|
||||
return encryptedContent;
|
||||
return q(encryptedContent);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user