mirror of
https://github.com/RGBCube/serenity
synced 2025-05-21 15:15: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:
parent
8f80879676
commit
6db11e5bba
1 changed files with 6 additions and 0 deletions
|
@ -5,6 +5,7 @@
|
||||||
#include "IRCQuery.h"
|
#include "IRCQuery.h"
|
||||||
#include "IRCWindow.h"
|
#include "IRCWindow.h"
|
||||||
#include "IRCWindowListModel.h"
|
#include "IRCWindowListModel.h"
|
||||||
|
#include <AK/QuickSort.h>
|
||||||
#include <AK/StringBuilder.h>
|
#include <AK/StringBuilder.h>
|
||||||
#include <LibCore/CNotifier.h>
|
#include <LibCore/CNotifier.h>
|
||||||
#include <arpa/inet.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_name = msg.arguments[2];
|
||||||
auto& channel = ensure_channel(channel_name);
|
auto& channel = ensure_channel(channel_name);
|
||||||
auto members = msg.arguments[3].split(' ');
|
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) {
|
for (auto& member : members) {
|
||||||
if (member.is_empty())
|
if (member.is_empty())
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue