mirror of
https://github.com/the-draupnir-project/Draupnir.git
synced 2026-04-27 11:25:23 +00:00
Fix Draupnir's joinOnInviteListener.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user