You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-29 16:43:09 +03:00
Don't create Olm sessions proactively
In what I hoped would be a five-minute refactor to help clean up an annoying not-really-used codepath, but turned into a bit of a hackathon on the tests, create Olm sessions lazily in Olm rooms, just as we do in megolm rooms, which allows us to avoid having to get the member list before configuring e2e in a room.
This commit is contained in:
@@ -453,18 +453,8 @@ MatrixClient.prototype.setRoomEncryption = function(roomId, config) {
|
||||
if (!this._crypto) {
|
||||
throw new Error("End-to-End encryption disabled");
|
||||
}
|
||||
|
||||
var roomMembers = [];
|
||||
var room = this.getRoom(roomId);
|
||||
if (!room) {
|
||||
console.warn("Enabling encryption in unknown room " + roomId);
|
||||
} else {
|
||||
roomMembers = utils.map(room.getJoinedMembers(), function(u) {
|
||||
return u.userId;
|
||||
});
|
||||
}
|
||||
|
||||
return this._crypto.setRoomEncryption(roomId, config, roomMembers);
|
||||
this._crypto.setRoomEncryption(roomId, config);
|
||||
return q();
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user