Skip to content

Commit c7ba745

Browse files
committed
Stop ProtectedRoomsSet verifying permissions for unprotected rooms.
1 parent c537f20 commit c7ba745

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/ProtectedRoomsSet.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@ export class ProtectedRoomsSet {
173173
if (event['sender'] === this.clientUserId) {
174174
throw new TypeError("`ProtectedRooms::handleEvent` should not be used to inform about events sent by mjolnir.");
175175
}
176+
if (!this.protectedRooms.has(roomId)) {
177+
return; // We're not protecting this room.
178+
}
176179
this.protectedRoomActivityTracker.handleEvent(roomId, event);
177180
if (event['type'] === 'm.room.power_levels' && event['state_key'] === '') {
178181
// power levels were updated - recheck permissions

0 commit comments

Comments
 (0)