mirror of
https://github.com/matrix-org/mjolnir.git
synced 2024-07-04 18:41:20 +00:00
Fix logging for status command
This commit is contained in:
parent
cebd0309cb
commit
c1ea98f55d
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright 2019 The Matrix.org Foundation C.I.C.
|
Copyright 2019, 2020 The Matrix.org Foundation C.I.C.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
@ -48,7 +48,7 @@ export async function execStatusCommand(roomId: string, event: any, mjolnir: Mjo
|
||||||
}
|
}
|
||||||
|
|
||||||
html += `<b>Protected rooms: </b> ${Object.keys(mjolnir.protectedRooms).length}<br/>`;
|
html += `<b>Protected rooms: </b> ${Object.keys(mjolnir.protectedRooms).length}<br/>`;
|
||||||
text += `Protected rooms: ${mjolnir.protectedRooms.length}\n`;
|
text += `Protected rooms: ${Object.keys(mjolnir.protectedRooms).length}\n`;
|
||||||
|
|
||||||
// Append list information
|
// Append list information
|
||||||
html += "<b>Subscribed ban lists:</b><br><ul>";
|
html += "<b>Subscribed ban lists:</b><br><ul>";
|
||||||
|
@ -58,6 +58,10 @@ export async function execStatusCommand(roomId: string, event: any, mjolnir: Mjo
|
||||||
html += `<li><a href="${list.roomRef}">${list.roomId}</a> (${ruleInfo})</li>`;
|
html += `<li><a href="${list.roomRef}">${list.roomId}</a> (${ruleInfo})</li>`;
|
||||||
text += `* ${list.roomRef} (${ruleInfo})\n`;
|
text += `* ${list.roomRef} (${ruleInfo})\n`;
|
||||||
}
|
}
|
||||||
|
if (mjolnir.lists.length === 0) {
|
||||||
|
html += "<li><i>None</i></li>";
|
||||||
|
text += "* None\n";
|
||||||
|
}
|
||||||
html += "</ul>";
|
html += "</ul>";
|
||||||
|
|
||||||
const reply = RichReply.createFor(roomId, event, text, html);
|
const reply = RichReply.createFor(roomId, event, text, html);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user