mirror of
https://github.com/RGBCube/serenity
synced 2025-05-30 19:38:12 +00:00
IRCClient: Implement "/msg <nick> ..."
This commit is contained in:
parent
5e6c1c6912
commit
ecbf1b673a
1 changed files with 10 additions and 1 deletions
|
@ -588,7 +588,7 @@ void IRCClient::unregister_subwindow(IRCWindow& subwindow)
|
||||||
|
|
||||||
void IRCClient::handle_user_command(const String& input)
|
void IRCClient::handle_user_command(const String& input)
|
||||||
{
|
{
|
||||||
auto parts = input.split(' ');
|
auto parts = input.split_view(' ');
|
||||||
if (parts.is_empty())
|
if (parts.is_empty())
|
||||||
return;
|
return;
|
||||||
auto command = String(parts[0]).to_uppercase();
|
auto command = String(parts[0]).to_uppercase();
|
||||||
|
@ -614,6 +614,15 @@ void IRCClient::handle_user_command(const String& input)
|
||||||
}
|
}
|
||||||
return;
|
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 (command == "/WHOIS") {
|
||||||
if (parts.size() >= 2)
|
if (parts.size() >= 2)
|
||||||
send_whois(parts[1]);
|
send_whois(parts[1]);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue