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

IRCClient: Add ability to send query messages.

You can't open a query yet, but if someone starts one with you, you can
respond at least.
This commit is contained in:
Andreas Kling 2019-03-15 18:02:38 +01:00
parent 7e3673f710
commit 08c15be0ca
5 changed files with 21 additions and 3 deletions

View file

@ -253,6 +253,7 @@ void IRCClient::handle_user_input_in_query(const String& query_name, const Strin
{
if (input.is_empty())
return;
ensure_query(query_name).say(input);
}
void IRCClient::handle_user_input_in_server(const String& input)
@ -307,7 +308,7 @@ void IRCClient::handle_privmsg(const Message& msg)
auto& query = ensure_query(sender_nick);
query.add_message(sender_prefix, sender_nick, msg.arguments[1]);
if (on_query_message)
on_query_message(target);
on_query_message(sender_nick);
}
IRCQuery& IRCClient::ensure_query(const String& name)
@ -336,7 +337,7 @@ void IRCClient::handle_ping(const Message& msg)
{
if (msg.arguments.size() < 0)
return;
m_log->add_message(0, "", String::format("Ping? Pong! %s\n", msg.arguments[0].characters()));
m_log->add_message(0, "Server", "Ping? Pong!");
send_pong(msg.arguments[0]);
}