mirror of
https://github.com/matrix-org/mjolnir.git
synced 2024-10-01 01:36:06 -04:00
Appease the linter
This commit is contained in:
parent
90640b6714
commit
f616ecccb3
@ -70,11 +70,11 @@ if (config.health.healthz.enabled) {
|
||||
}
|
||||
|
||||
// Switch to using the rule server if we need to
|
||||
const banLists: BanList[] = [];
|
||||
if (config.ruleServer?.enabled) {
|
||||
await logMessage(LogLevel.INFO, "index", "Rule server is starting up.");
|
||||
|
||||
// Resolve all the rule server's watched rooms
|
||||
const banLists: BanList[] = [];
|
||||
for (const roomRef of config.ruleServer.listRooms) {
|
||||
const permalink = Permalinks.parseUrl(roomRef);
|
||||
if (!permalink.roomIdOrAlias) continue;
|
||||
@ -121,7 +121,6 @@ if (config.health.healthz.enabled) {
|
||||
return client.joinRoom(roomId);
|
||||
});
|
||||
|
||||
const banLists: BanList[] = [];
|
||||
const protectedRooms: { [roomId: string]: string } = {};
|
||||
|
||||
// Ensure we're also joined to the rooms we're protecting
|
||||
|
@ -72,11 +72,13 @@ export class RuleServer {
|
||||
}
|
||||
|
||||
private async rebuildRules() {
|
||||
const userRules = this.banLists.map(b => b.userRules).reduce((a, c) => {a.push(...c); return a;}, []);
|
||||
const roomRules = this.banLists.map(b => b.roomRules).reduce((a, c) => {a.push(...c); return a;}, []);
|
||||
const serverRules = this.banLists.map(b => b.serverRules).reduce((a, c) => {a.push(...c); return a;}, []);
|
||||
|
||||
console.log({userRules, roomRules, serverRules});
|
||||
const doReduce = (a, c) => {
|
||||
a.push(...c);
|
||||
return a;
|
||||
};
|
||||
const userRules = this.banLists.map(b => b.userRules).reduce(doReduce, []);
|
||||
const roomRules = this.banLists.map(b => b.roomRules).reduce(doReduce, []);
|
||||
const serverRules = this.banLists.map(b => b.serverRules).reduce(doReduce, []);
|
||||
|
||||
this.pyRules = {
|
||||
checks: {
|
||||
|
Loading…
Reference in New Issue
Block a user