mirror of
https://github.com/matrix-org/mjolnir.git
synced 2024-09-28 20:26:02 +00:00
Stop Mjolnir blindly protecting all policy lists at startup. (#431)
`Mjolnir.resyncAllJoinedRooms` needs policy lists to be loaded into mjolnir in order to filter them out of the protect rooms set (unless explicitly protected). This is so that you don't end up having mjolnir complain about protecting a list which you have no control over, and are just watching (e.g. #matrix-org-coc-bl:matrix.org).
This commit is contained in:
parent
0845636d39
commit
410ceebd62
@ -291,8 +291,10 @@ export class Mjolnir {
|
|||||||
await this.protectedRoomsConfig.loadProtectedRoomsFromConfig(this.config);
|
await this.protectedRoomsConfig.loadProtectedRoomsFromConfig(this.config);
|
||||||
await this.protectedRoomsConfig.loadProtectedRoomsFromAccountData();
|
await this.protectedRoomsConfig.loadProtectedRoomsFromAccountData();
|
||||||
this.protectedRoomsConfig.getExplicitlyProtectedRooms().forEach(this.protectRoom, this);
|
this.protectedRoomsConfig.getExplicitlyProtectedRooms().forEach(this.protectRoom, this);
|
||||||
await this.resyncJoinedRooms(false);
|
// We have to build the policy lists before calling `resyncJoinedRooms` otherwise mjolnir will try to protect
|
||||||
|
// every policy list we are already joined to, as mjolnir will not be able to distinguish them from normal rooms.
|
||||||
await this.buildWatchedPolicyLists();
|
await this.buildWatchedPolicyLists();
|
||||||
|
await this.resyncJoinedRooms(false);
|
||||||
await this.protectionManager.start();
|
await this.protectionManager.start();
|
||||||
|
|
||||||
if (this.config.verifyPermissionsOnStartup) {
|
if (this.config.verifyPermissionsOnStartup) {
|
||||||
|
Loading…
Reference in New Issue
Block a user