Move power level change notices to DEBUG

Fixes https://github.com/matrix-org/mjolnir/issues/32
This commit is contained in:
Travis Ralston 2020-02-12 15:42:10 -07:00
parent f7448564be
commit 223464227b

View File

@ -507,25 +507,11 @@ export class Mjolnir {
// power levels were updated - recheck permissions // power levels were updated - recheck permissions
ErrorCache.resetError(roomId, ERROR_KIND_PERMISSION); ErrorCache.resetError(roomId, ERROR_KIND_PERMISSION);
const url = this.protectedRooms[roomId]; const url = this.protectedRooms[roomId];
let html = `Power levels changed in <a href="${url}">${roomId}</a> - checking permissions...`; await logMessage(LogLevel.DEBUG, "Mjolnir", `Power levels changed in ${url} - checking permissions...`);
let text = `Power levels changed in ${url} - checking permissions...`;
await this.client.sendMessage(config.managementRoom, {
msgtype: "m.notice",
body: text,
format: "org.matrix.custom.html",
formatted_body: html,
});
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) {
html = `<font color="#00cc00">All permissions look OK.</font>`; await logMessage(LogLevel.DEBUG, "Mjolnir", `All permissions look OK.`);
text = "All permissions look OK.";
await this.client.sendMessage(config.managementRoom, {
msgtype: "m.notice",
body: text,
format: "org.matrix.custom.html",
formatted_body: html,
});
} }
return; return;
} else if (event['type'] === "m.room.member") { } else if (event['type'] === "m.room.member") {