diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-08-23 21:59:43 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-08-23 21:59:43 +0300 |
commit | 1a652f220d1c74333cd2f54953dbaf41907314b6 (patch) | |
tree | fdaf09d8cb84ca036bdf73c47b0de5165d9e773d /src/actions | |
parent | 475aa157df7400ce40ef9a5cc4cb441291d45df9 (diff) | |
download | manaverse-1a652f220d1c74333cd2f54953dbaf41907314b6.tar.gz manaverse-1a652f220d1c74333cd2f54953dbaf41907314b6.tar.bz2 manaverse-1a652f220d1c74333cd2f54953dbaf41907314b6.tar.xz manaverse-1a652f220d1c74333cd2f54953dbaf41907314b6.zip |
Move chat command /query into actions.
Diffstat (limited to 'src/actions')
-rw-r--r-- | src/actions/chat.cpp | 21 | ||||
-rw-r--r-- | src/actions/chat.h | 1 |
2 files changed, 22 insertions, 0 deletions
diff --git a/src/actions/chat.cpp b/src/actions/chat.cpp index 08b3e0014..858b5acbb 100644 --- a/src/actions/chat.cpp +++ b/src/actions/chat.cpp @@ -211,4 +211,25 @@ impHandler(msg) return true; } +impHandler(query) +{ + if (chatWindow) + { + if (chatWindow->addWhisperTab(event.args, true)) + { + chatWindow->saveState(); + return true; + } + } + + if (event.tab) + { + // TRANSLATORS: new whisper query + event.tab->chatLog(strprintf(_("Cannot create a whisper tab for nick " + "\"%s\"! It either already exists, or is you."), + event.args.c_str()), ChatMsgType::BY_SERVER); + } + return true; +} + } // namespace Actions diff --git a/src/actions/chat.h b/src/actions/chat.h index b653e6efb..fe35021be 100644 --- a/src/actions/chat.h +++ b/src/actions/chat.h @@ -36,6 +36,7 @@ namespace Actions decHandler(scrollChatUp); decHandler(scrollChatDown); decHandler(msg); + decHandler(query); } // namespace Actions #undef decHandler |