mirror of
https://github.com/matrix-org/mjolnir.git
synced 2024-07-07 11:51:56 +00:00
Appease the linter
This commit is contained in:
parent
49468c5aab
commit
cb20aefea3
|
@ -171,7 +171,7 @@ export class Mjolnir {
|
||||||
this.banLists = banLists;
|
this.banLists = banLists;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async verifyPermissions(verbose: boolean = true) {
|
public async verifyPermissions(verbose = true) {
|
||||||
const errors: RoomUpdateError[] = [];
|
const errors: RoomUpdateError[] = [];
|
||||||
for (const roomId of Object.keys(this.protectedRooms)) {
|
for (const roomId of Object.keys(this.protectedRooms)) {
|
||||||
errors.push(...(await this.verifyPermissionsIn(roomId)));
|
errors.push(...(await this.verifyPermissionsIn(roomId)));
|
||||||
|
@ -242,7 +242,7 @@ export class Mjolnir {
|
||||||
return errors;
|
return errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async syncLists(verbose: boolean = true) {
|
public async syncLists(verbose = true) {
|
||||||
for (const list of this.banLists) {
|
for (const list of this.banLists) {
|
||||||
await list.updateList();
|
await list.updateList();
|
||||||
}
|
}
|
||||||
|
@ -300,8 +300,8 @@ export class Mjolnir {
|
||||||
if (event['type'] === 'm.room.power_levels' && event['state_key'] === '') {
|
if (event['type'] === 'm.room.power_levels' && event['state_key'] === '') {
|
||||||
// power levels were updated - recheck permissions
|
// power levels were updated - recheck permissions
|
||||||
const url = this.protectedRooms[roomId];
|
const url = this.protectedRooms[roomId];
|
||||||
const html = `Power levels changed in <a href="${url}">${roomId}</a> - checking permissions...`;
|
let html = `Power levels changed in <a href="${url}">${roomId}</a> - checking permissions...`;
|
||||||
const text = `Power levels changed in ${url} - checking permissions...`;
|
let text = `Power levels changed in ${url} - checking permissions...`;
|
||||||
await this.client.sendMessage(this.managementRoomId, {
|
await this.client.sendMessage(this.managementRoomId, {
|
||||||
msgtype: "m.notice",
|
msgtype: "m.notice",
|
||||||
body: text,
|
body: text,
|
||||||
|
@ -311,8 +311,8 @@ export class Mjolnir {
|
||||||
const errors = await this.verifyPermissionsIn(roomId);
|
const errors = await this.verifyPermissionsIn(roomId);
|
||||||
const hadErrors = await this.printActionResult(errors);
|
const hadErrors = await this.printActionResult(errors);
|
||||||
if (!hadErrors) {
|
if (!hadErrors) {
|
||||||
const html = `<font color="#00cc00">All permissions look OK.</font>`;
|
html = `<font color="#00cc00">All permissions look OK.</font>`;
|
||||||
const text = "All permissions look OK.";
|
text = "All permissions look OK.";
|
||||||
await this.client.sendMessage(this.managementRoomId, {
|
await this.client.sendMessage(this.managementRoomId, {
|
||||||
msgtype: "m.notice",
|
msgtype: "m.notice",
|
||||||
body: text,
|
body: text,
|
||||||
|
|
|
@ -24,7 +24,7 @@ export async function execStatusCommand(roomId: string, event: any, mjolnir: Mjo
|
||||||
|
|
||||||
const state = mjolnir.state;
|
const state = mjolnir.state;
|
||||||
|
|
||||||
switch(state) {
|
switch (state) {
|
||||||
case STATE_NOT_STARTED:
|
case STATE_NOT_STARTED:
|
||||||
html += "<b>Running: </b>❌ (not started)<br/>";
|
html += "<b>Running: </b>❌ (not started)<br/>";
|
||||||
text += "Running: ❌ (not started)\n";
|
text += "Running: ❌ (not started)\n";
|
||||||
|
|
Loading…
Reference in New Issue
Block a user