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