diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2011-02-21 23:23:24 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2011-02-21 23:23:24 +0100 |
commit | 458401d64fbe500295cc8e903702638fde0ab934 (patch) | |
tree | 3d1c606f118dba2b4f38fa80614bf30fdc12277c /src/commandhandler.cpp | |
parent | e6cd1f9cb82811d05e08aef0493eeba9cc41a95d (diff) | |
parent | d4bb2d1d0e82ca9d046f9b2346a7893ca11e8d9c (diff) | |
download | mana-458401d64fbe500295cc8e903702638fde0ab934.tar.gz mana-458401d64fbe500295cc8e903702638fde0ab934.tar.bz2 mana-458401d64fbe500295cc8e903702638fde0ab934.tar.xz mana-458401d64fbe500295cc8e903702638fde0ab934.zip |
Merge branch '0.5'
Translation file updates ignored.
Conflicts:
src/client.cpp
src/commandhandler.cpp
src/gui/popupmenu.cpp
src/localplayer.cpp
Diffstat (limited to 'src/commandhandler.cpp')
-rw-r--r-- | src/commandhandler.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/commandhandler.cpp b/src/commandhandler.cpp index dcaf6f0a..f5864a24 100644 --- a/src/commandhandler.cpp +++ b/src/commandhandler.cpp @@ -49,6 +49,7 @@ void CommandHandler::handleCommand(const std::string &command, ChatTab *tab) std::string type(command, 0, pos); std::string args(command, pos == std::string::npos ? command.size() : pos + 1); + trim(args); if (type == "help") // Do help before tabs so they can't override it { @@ -401,8 +402,21 @@ void CommandHandler::handleMsg(const std::string &args, ChatTab *tab) void CommandHandler::handleQuery(const std::string &args, ChatTab *tab) { - if (chatWindow->addWhisperTab(args, true)) + if (args.empty()) + { + tab->chatLog(_("No <nick> was given."), BY_SERVER); + return; + } + + if (args.length() > 1 && args[0] == '\"' && args[args.length() - 1] == '\"') + { + if (chatWindow->addWhisperTab(args.substr(1, args.length() - 2), true)) + return; + } + else if (chatWindow->addWhisperTab(args, true)) + { return; + } tab->chatLog(strprintf(_("Cannot create a whisper tab for nick \"%s\"! " "It either already exists, or is you."), args.c_str()), BY_SERVER); |