summaryrefslogtreecommitdiff
path: root/src/gui/widgets/tabs/chattab.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-08-27 22:12:02 +0300
committerAndrei Karas <akaras@inbox.ru>2014-08-27 22:12:02 +0300
commit6d72b3a19ae68d5eedd425a0f58c4226dfde7001 (patch)
tree355804ca43938218858c82d057c65771eec98585 /src/gui/widgets/tabs/chattab.cpp
parentda07e7ecce244b541656e88a4cdeec1df7c699cc (diff)
downloadmanaverse-6d72b3a19ae68d5eedd425a0f58c4226dfde7001.tar.gz
manaverse-6d72b3a19ae68d5eedd425a0f58c4226dfde7001.tar.bz2
manaverse-6d72b3a19ae68d5eedd425a0f58c4226dfde7001.tar.xz
manaverse-6d72b3a19ae68d5eedd425a0f58c4226dfde7001.zip
Restore invoking chat commands.
Was removed in previous commits.
Diffstat (limited to 'src/gui/widgets/tabs/chattab.cpp')
-rw-r--r--src/gui/widgets/tabs/chattab.cpp10
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)