Move ban message to INFO

Fixes https://github.com/matrix-org/mjolnir/issues/19
This commit is contained in:
Travis Ralston 2020-02-13 13:46:09 -07:00
parent 5b4c253002
commit 8e5f8c19af

View File

@ -65,7 +65,7 @@ export async function applyUserBans(lists: BanList[], roomIds: string[], mjolnir
// User needs to be banned
// We specifically use sendNotice to avoid having to escape HTML
await logMessage(LogLevel.DEBUG, "ApplyBan", `Banning ${member.userId} in ${roomId} for: ${userRule.reason}`);
await logMessage(LogLevel.INFO, "ApplyBan", `Banning ${member.userId} in ${roomId} for: ${userRule.reason}`);
if (!config.noop) {
// Always prioritize redactions above bans
@ -96,16 +96,5 @@ export async function applyUserBans(lists: BanList[], roomIds: string[], mjolnir
}
}
if (bansApplied > 0) {
const html = `<font color="#00cc00"><b>Banned ${bansApplied} people</b></font>`;
const text = `Banned ${bansApplied} people`;
await mjolnir.client.sendMessage(config.managementRoom, {
msgtype: "m.notice",
body: text,
format: "org.matrix.custom.html",
formatted_body: html,
});
}
return errors;
}