summaryrefslogtreecommitdiff
path: root/Applications/IRCClient/IRCClient.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-07-13 12:02:31 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-07-13 12:02:31 +0200
commitecbf1b673a958d1372b066e99dcbe509c9eb0cf0 (patch)
treeddb4e12ee0b92a9f172969b9ddf117260409340f /Applications/IRCClient/IRCClient.cpp
parent5e6c1c6912801e201fd55902002dc82d4895428f (diff)
downloadserenity-ecbf1b673a958d1372b066e99dcbe509c9eb0cf0.zip
IRCClient: Implement "/msg <nick> ..."
Diffstat (limited to 'Applications/IRCClient/IRCClient.cpp')
-rw-r--r--Applications/IRCClient/IRCClient.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/Applications/IRCClient/IRCClient.cpp b/Applications/IRCClient/IRCClient.cpp
index d9a6833731..8847270438 100644
--- a/Applications/IRCClient/IRCClient.cpp
+++ b/Applications/IRCClient/IRCClient.cpp
@@ -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]);