diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-08-27 22:12:02 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-08-27 22:12:02 +0300 |
commit | 6d72b3a19ae68d5eedd425a0f58c4226dfde7001 (patch) | |
tree | 355804ca43938218858c82d057c65771eec98585 | |
parent | da07e7ecce244b541656e88a4cdeec1df7c699cc (diff) | |
download | mv-6d72b3a19ae68d5eedd425a0f58c4226dfde7001.tar.gz mv-6d72b3a19ae68d5eedd425a0f58c4226dfde7001.tar.bz2 mv-6d72b3a19ae68d5eedd425a0f58c4226dfde7001.tar.xz mv-6d72b3a19ae68d5eedd425a0f58c4226dfde7001.zip |
Restore invoking chat commands.
Was removed in previous commits.
-rw-r--r-- | src/gui/widgets/tabs/chattab.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gui/widgets/tabs/chattab.cpp b/src/gui/widgets/tabs/chattab.cpp index 4b37e2ada..31c4fb0ab 100644 --- a/src/gui/widgets/tabs/chattab.cpp +++ b/src/gui/widgets/tabs/chattab.cpp @@ -42,6 +42,8 @@ #include "gui/widgets/tabs/chattabtype.h" +#include "input/inputmanager.h" + #include "net/chathandler.h" #include "net/net.h" @@ -436,8 +438,14 @@ void ChatTab::handleInput(const std::string &msg) mChannelName); } -void ChatTab::handleCommand(const std::string &msg A_UNUSED) +void ChatTab::handleCommand(const std::string &msg) { + const size_t pos = msg.find(' '); + const std::string type(msg, 0, pos); + std::string args(msg, pos == std::string::npos ? msg.size() : pos + 1); + + args = trim(args); + inputManager.executeChatCommand(type, args, this); } void ChatTab::handleHelp(const std::string &msg) |