Skip to content

Commit 536b0c6

Browse files
authored
Sort by channel name in !listrooms (#1715)
* Sort by channel name in !listrooms It's stored as a set in the client object, which doesn't guarantee anything about the order, so sort it for consistent output. Signed-off-by: Dagfinn Ilmari Mannsåker <[email protected]> * Add changelog entry --------- Signed-off-by: Dagfinn Ilmari Mannsåker <[email protected]>
1 parent 3ad4ae7 commit 536b0c6

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

changelog.d/1715.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Sort the list of channels in !listrooms output.

src/bridge/AdminRoomHandler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ export class AdminRoomHandler {
601601

602602
let chanList = `You are joined to ${client.chanList.size} rooms: \n\n`;
603603
let chanListHTML = `<p>You are joined to <code>${client.chanList.size}</code> rooms:</p><ul>`;
604-
for (const channel of client.chanList) {
604+
for (const channel of [...client.chanList].sort()) {
605605
const rooms = await this.ircBridge.getStore().getMatrixRoomsForChannel(server, channel);
606606
chanList += `- \`${channel}\` which is bridged to ${rooms.map((r) => r.getId()).join(", ")}`;
607607
const roomMentions = rooms

0 commit comments

Comments
 (0)