From 6d72b3a19ae68d5eedd425a0f58c4226dfde7001 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 27 Aug 2014 22:12:02 +0300 Subject: Restore invoking chat commands. Was removed in previous commits. --- src/gui/widgets/tabs/chattab.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3-70-g09d2