From a9e6e11d1f7d819159d0cad261545e3732158fc1 Mon Sep 17 00:00:00 2001 From: Andrew Ferrazzutti Date: Fri, 14 Oct 2022 02:25:46 -0400 Subject: [PATCH] Block post-join actions on crypto setup Requires https://github.com/turt2live/matrix-bot-sdk/pull/269 --- src/Bridge.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Bridge.ts b/src/Bridge.ts index bca441bd0..171789c69 100644 --- a/src/Bridge.ts +++ b/src/Bridge.ts @@ -905,6 +905,12 @@ export class Bridge { return; } + if (this.config.encryption) { + // Ensure crypto is aware of all members of this room before posting any messages, + // so that the bot can share room keys to all recipients first. + await this.as.botClient.crypto.onRoomJoin(roomId); + } + const adminAccountData = await this.as.botIntent.underlyingClient.getSafeRoomAccountData( BRIDGE_ROOM_TYPE, roomId, );