mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +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:
committed by
Andreas Kling
parent
8f80879676
commit
6db11e5bba
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user