summaryrefslogtreecommitdiff
path: root/src/commandhandler.cpp
diff options
context:
space:
mode:
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."));
+ }
}
}