1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 18:05:07 +00:00

IRCClient: Sort the member list ignoring the character cases.

I compared a few clients and they do the same sort of sorting.
This commit is contained in:
Sasan Hezarkhani 2019-12-02 17:48:31 -08:00 committed by Andreas Kling
parent 8f80879676
commit 6db11e5bba

View file

@ -5,6 +5,7 @@
#include "IRCQuery.h"
#include "IRCWindow.h"
#include "IRCWindowListModel.h"
#include <AK/QuickSort.h>
#include <AK/StringBuilder.h>
#include <LibCore/CNotifier.h>
#include <arpa/inet.h>
@ -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;