1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-29 16:43:09 +03:00

Merge pull request #179 from matrix-org/rav/send_megolm_keys

Send out megolm keys when we start a megolm session
This commit is contained in:
Richard van der Hoff
2016-08-23 17:30:12 +01:00
committed by GitHub
4 changed files with 92 additions and 15 deletions

View File

@@ -540,6 +540,7 @@ Crypto.prototype.setRoomEncryption = function(roomId, config, roomMembers) {
deviceId: this._deviceId,
crypto: this,
olmDevice: this._olmDevice,
baseApis: this._baseApis,
roomId: roomId,
});
this._roomAlgorithms[roomId] = alg;
@@ -678,6 +679,10 @@ Crypto.prototype.encryptEventIfNeeded = function(event, room) {
return null;
}
if (!room) {
throw new Error("Cannot send encrypted messages in unknown rooms");
}
var roomId = event.getRoomId();
var alg = this._roomAlgorithms[roomId];