diff --git a/src/matrix/Session.js b/src/matrix/Session.js index 63b954af..b4cbf3b2 100644 --- a/src/matrix/Session.js +++ b/src/matrix/Session.js @@ -217,7 +217,7 @@ export class Session { this._sendScheduler.start(); for (const [, room] of this._rooms) { - room.resumeSending(); + room.start(); } } diff --git a/src/matrix/room/Room.js b/src/matrix/room/Room.js index 55bb1ccb..3c417082 100644 --- a/src/matrix/room/Room.js +++ b/src/matrix/room/Room.js @@ -217,7 +217,16 @@ export class Room extends EventEmitter { } /** @package */ - resumeSending() { + async start() { + if (this._roomEncryption) { + try { + // if we got interrupted last time sending keys to newly joined members + await this._roomEncryption.shareRoomKeyToPendingMembers(this._hsApi); + } catch (err) { + // we should not throw here + console.error(`could not send out pending room keys for room ${this.id}`, err.stack); + } + } this._sendQueue.resumeSending(); }