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

Send out megolm keys when we start a megolm session

For now, pending the arrival of SPEC-138, this happens via inline messages in
the room.
This commit is contained in:
Richard van der Hoff
2016-08-22 17:09:24 +01:00
parent e4bfb3ca32
commit 238700cbdb
4 changed files with 86 additions and 15 deletions

View File

@@ -56,17 +56,13 @@ OlmEncryption.prototype.initRoomEncryption = function(roomMembers) {
/**
* @inheritdoc
*
* @param {module:models/room?} room
* @param {module:models/room} room
* @param {string} eventType
* @param {object} plaintext event content
*
* @return {module:client.Promise} Promise which resolves to the new event body
*/
OlmEncryption.prototype.encryptMessage = function(room, eventType, content) {
if (!room) {
throw new Error("Cannot send encrypted messages in unknown rooms");
}
// pick the list of recipients based on the membership list.
//
// TODO: there is a race condition here! What if a new user turns up