mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:37:43 +00:00
IRCClient: Update channel user list when a user joins or quits
This commit is contained in:
parent
99aab4470a
commit
40b3203941
4 changed files with 37 additions and 1 deletions
|
@ -290,6 +290,9 @@ void IRCClient::handle(const Message& msg)
|
|||
if (msg.command == "PART")
|
||||
return handle_part(msg);
|
||||
|
||||
if (msg.command == "QUIT")
|
||||
return handle_quit(msg);
|
||||
|
||||
if (msg.command == "TOPIC")
|
||||
return handle_topic(msg);
|
||||
|
||||
|
@ -545,6 +548,20 @@ void IRCClient::handle_part(const Message& msg)
|
|||
ensure_channel(channel_name).handle_part(nick, msg.prefix);
|
||||
}
|
||||
|
||||
void IRCClient::handle_quit(const Message& msg)
|
||||
{
|
||||
if (msg.arguments.size() < 1)
|
||||
return;
|
||||
auto prefix_parts = msg.prefix.split('!');
|
||||
if (prefix_parts.size() < 1)
|
||||
return;
|
||||
auto nick = prefix_parts[0];
|
||||
auto& message = msg.arguments[0];
|
||||
for (auto& it : m_channels) {
|
||||
it.value->handle_quit(nick, msg.prefix, message);
|
||||
}
|
||||
}
|
||||
|
||||
void IRCClient::handle_nick(const Message& msg)
|
||||
{
|
||||
auto prefix_parts = msg.prefix.split('!');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue