diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-07-13 12:02:31 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-07-13 12:02:31 +0200 |
commit | ecbf1b673a958d1372b066e99dcbe509c9eb0cf0 (patch) | |
tree | ddb4e12ee0b92a9f172969b9ddf117260409340f /Applications/IRCClient/IRCClient.cpp | |
parent | 5e6c1c6912801e201fd55902002dc82d4895428f (diff) | |
download | serenity-ecbf1b673a958d1372b066e99dcbe509c9eb0cf0.zip |
IRCClient: Implement "/msg <nick> ..."
Diffstat (limited to 'Applications/IRCClient/IRCClient.cpp')
-rw-r--r-- | Applications/IRCClient/IRCClient.cpp | 11 |
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]); |