Fix Draupnir's joinOnInviteListener.

This commit is contained in:
gnuxie
2024-02-18 20:04:51 +00:00
parent d718967a7c
commit 5a991897dc
2 changed files with 11 additions and 0 deletions
+8
View File
@@ -163,6 +163,14 @@ export class Draupnir implements Client {
if (isError(loadResult)) {
throw loadResult.error;
}
// we need to make sure that we are protecting the management room so we
// have immediate access to its membership (for accepting invitations).
const managementRoomProtectResult = await draupnir.protectedRoomsSet.protectedRoomsConfig.addRoom(
managementRoom
);
if (isError(managementRoomProtectResult)) {
throw managementRoomProtectResult.error;
}
return draupnir;
}
+3
View File
@@ -109,6 +109,9 @@ export async function makeDraupnirBotModeFromConfig(
const error = draupnir.error;
throw new Error(`Unable to create Draupnir: ${error.message}`);
}
matrixEmitter.on('room.invite', (roomID, event) => {
clientsInRoomMap.handleTimelineEvent(roomID, event);
})
matrixEmitter.on('room.event', (roomID, event) => {
roomStateManagerFactory.handleTimelineEvent(roomID, event);
clientsInRoomMap.handleTimelineEvent(roomID, event);