Skip to content

Commit

Permalink
Save bot-created admin rooms in profile data (#578)
Browse files Browse the repository at this point in the history
* Save bot-created admin rooms in profile data

This prevents a process restart from causing bot-created admin rooms
to be forgotten.

* Clarify changelog
  • Loading branch information
AndrewFerr authored Nov 25, 2022
1 parent 93e2dbe commit 2c5f248
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/578.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed a case where a bridge-created admin room would stop working on restart.
6 changes: 5 additions & 1 deletion src/Bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1185,7 +1185,11 @@ export class Bridge {
is_direct: true,
preset: "trusted_private_chat",
});
return this.setUpAdminRoom(roomId, {admin_user: userId}, NotifFilter.getDefaultContent());
const room = await this.setUpAdminRoom(roomId, {admin_user: userId}, NotifFilter.getDefaultContent());
await this.as.botClient.setRoomAccountData(
BRIDGE_ROOM_TYPE, roomId, room.accountData,
);
return room;
}

private async setUpAdminRoom(roomId: string, accountData: AdminAccountData, notifContent: NotificationFilterStateContent) {
Expand Down

0 comments on commit 2c5f248

Please sign in to comment.