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

IRCClient: Implement "/msg <nick> ..."

This commit is contained in:
Andreas Kling 2019-07-13 12:02:31 +02:00
parent 5e6c1c6912
commit ecbf1b673a

View file

@ -588,7 +588,7 @@ void IRCClient::unregister_subwindow(IRCWindow& subwindow)
void IRCClient::handle_user_command(const String& input)
{
auto parts = input.split(' ');
auto parts = input.split_view(' ');
if (parts.is_empty())
return;
auto command = String(parts[0]).to_uppercase();
@ -614,6 +614,15 @@ void IRCClient::handle_user_command(const String& input)
}
return;
}
if (command == "/MSG") {
if (parts.size() < 3)
return;
auto nick = parts[1];
auto& query = ensure_query(nick);
IRCAppWindow::the().set_active_window(query.window());
query.say(input.view().substring_view_starting_after_substring(nick));
return;
}
if (command == "/WHOIS") {
if (parts.size() >= 2)
send_whois(parts[1]);