Skip to content

Commit

Permalink
Refresh joined rooms when enabling crypto (#281)
Browse files Browse the repository at this point in the history
* Refresh joined rooms when enabling crypto

When enabling crypto on an Intent, refresh its list of joined rooms,
as it's used to determine which rooms to watch for crypto updates.

This fixes an issue where a restart would cause Intents to lose track of
which rooms they were joined to, until the list is refreshed either
manually or in response to a membership event.

Signed-off-by: Andrew Ferrazzutti <[email protected]>

* Update src/appservice/Intent.ts

Signed-off-by: Andrew Ferrazzutti <[email protected]>
Co-authored-by: Travis Ralston <[email protected]>
  • Loading branch information
AndrewFerr and turt2live authored Dec 19, 2022
1 parent 0474d68 commit 7b74b2d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/appservice/Intent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export class Intent {
}

// Now set up crypto
await this.client.crypto.prepare(await this.client.getJoinedRooms());
await this.client.crypto.prepare(await this.refreshJoinedRooms());

this.appservice.on("room.event", (roomId, event) => {
if (!this.knownJoinedRooms.includes(roomId)) return;
Expand Down

0 comments on commit 7b74b2d

Please sign in to comment.