From ea28a76cfbace0ccc8d25e523b410f2dea339423 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 18 May 2013 16:17:08 +0300 Subject: add new chat commands. /enablehighlight - enable sound hightlight in chat tab /disablehighlight - disable sound hightlight in chat tab --- src/commandhandler.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/commandhandler.cpp') diff --git a/src/commandhandler.cpp b/src/commandhandler.cpp index 4675ddd22..fc7d6dff8 100644 --- a/src/commandhandler.cpp +++ b/src/commandhandler.cpp @@ -53,6 +53,14 @@ void CommandHandler::handleCommand(const std::string &command, ? command.size() : pos + 1); args = trim(args); + invokeCommand(type, args, tab, true); +} + +void CommandHandler::invokeCommand(const std::string &type, + const std::string &args, + ChatTab *const tab, + const bool warn) +{ const CommandsMapIter it = mCommands.find(type); if (it != mCommands.end()) { @@ -60,7 +68,10 @@ void CommandHandler::handleCommand(const std::string &command, } else if (!tab->handleCommand(type, args)) { - // TRANSLATORS: chat commands handling message - tab->chatLog(_("Unknown command.")); + if (warn) + { + // TRANSLATORS: chat commands handling message + tab->chatLog(_("Unknown command.")); + } } } -- cgit v1.2.3-70-g09d2