summaryrefslogtreecommitdiff
path: root/src/commandhandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-05-18 16:17:08 +0300
committerAndrei Karas <akaras@inbox.ru>2013-05-18 16:17:08 +0300
commitea28a76cfbace0ccc8d25e523b410f2dea339423 (patch)
treec5582fe4d9b26dc381ef90ed7a155ea050514243 /src/commandhandler.cpp
parent8fdbbe936fc0bb99b0c3d851b7a5b522514ba2b9 (diff)
downloadmanaplus-ea28a76cfbace0ccc8d25e523b410f2dea339423.tar.gz
manaplus-ea28a76cfbace0ccc8d25e523b410f2dea339423.tar.bz2
manaplus-ea28a76cfbace0ccc8d25e523b410f2dea339423.tar.xz
manaplus-ea28a76cfbace0ccc8d25e523b410f2dea339423.zip
add new chat commands.
/enablehighlight - enable sound hightlight in chat tab /disablehighlight - disable sound hightlight in chat tab
Diffstat (limited to 'src/commandhandler.cpp')
-rw-r--r--src/commandhandler.cpp15
1 files changed, 13 insertions, 2 deletions
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."));
+ }
}
}