1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:48:12 +00:00

IRCClient: Add handling of some basic messages and commands.

This commit is contained in:
Andreas Kling 2019-03-16 12:21:42 +01:00
parent b4f787090c
commit f44ba6a4c6
5 changed files with 123 additions and 3 deletions

View file

@ -55,3 +55,24 @@ void IRCChannel::say(const String& text)
m_client.send_privmsg(m_name, text);
add_message(' ', m_client.nickname(), text);
}
void IRCChannel::handle_join(const String& nick, const String& hostmask)
{
if (nick == m_client.nickname())
m_open = true;
add_message(' ', "", String::format("*** %s [%s] has joined %s", nick.characters(), hostmask.characters(), m_name.characters()));
}
void IRCChannel::handle_part(const String& nick, const String& hostmask)
{
if (nick == m_client.nickname())
m_open = false;
add_message(' ', "", String::format("*** %s [%s] has parted from %s", nick.characters(), hostmask.characters(), m_name.characters()));
}
void IRCChannel::handle_topic(const String& nick, const String& topic)
{
if (nick == m_client.nickname())
m_open = false;
add_message(' ', "", String::format("*** %s set topic to \"%s\"", nick.characters(), topic.characters()));
}