From 6db11e5bba2a56c983569eb95ebb06e70a4f592c Mon Sep 17 00:00:00 2001 From: Sasan Hezarkhani Date: Mon, 2 Dec 2019 17:48:31 -0800 Subject: [PATCH] IRCClient: Sort the member list ignoring the character cases. I compared a few clients and they do the same sort of sorting. --- Applications/IRCClient/IRCClient.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Applications/IRCClient/IRCClient.cpp b/Applications/IRCClient/IRCClient.cpp index e98391d1f4..c9633e78af 100644 --- a/Applications/IRCClient/IRCClient.cpp +++ b/Applications/IRCClient/IRCClient.cpp @@ -5,6 +5,7 @@ #include "IRCQuery.h" #include "IRCWindow.h" #include "IRCWindowListModel.h" +#include #include #include #include @@ -513,6 +514,11 @@ void IRCClient::handle_rpl_namreply(const Message& msg) auto& channel_name = msg.arguments[2]; auto& channel = ensure_channel(channel_name); auto members = msg.arguments[3].split(' '); + + quick_sort(members.begin(), members.end(), [](auto& a, auto& b) { + return strcasecmp(a.characters(), b.characters()) < 0; + }); + for (auto& member : members) { if (member.is_empty()) continue;