From cc06df44833d5e39b32065bb7892e787f6a1f54c Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 12 Dec 2014 18:40:43 +0300 Subject: Add chat command to show "/w NICK" message or open whisper tab (depend on settings) New chat command: /whispertext NICK Aliases: /wt NICK /msgtext NICK --- src/actions/chat.cpp | 17 +++++++++++++++++ src/actions/chat.h | 1 + 2 files changed, 18 insertions(+) (limited to 'src/actions') diff --git a/src/actions/chat.cpp b/src/actions/chat.cpp index 2c7d84f91..59b69b911 100644 --- a/src/actions/chat.cpp +++ b/src/actions/chat.cpp @@ -20,6 +20,7 @@ #include "actions/chat.h" +#include "configuration.h" #include "guildmanager.h" #include "actions/actiondef.h" @@ -244,6 +245,22 @@ impHandler(msg) return true; } +impHandler(msgText) +{ + if (!chatWindow) + return false; + + if (config.getBoolValue("whispertab")) + { + chatWindow->localChatInput("/q " + event.args); + } + else + { + chatWindow->addInputText(std::string("/w \"").append( + event.args).append("\" ")); + } +} + impHandler(msg2) { std::string recvnick; diff --git a/src/actions/chat.h b/src/actions/chat.h index 459ee675d..c42e4940b 100644 --- a/src/actions/chat.h +++ b/src/actions/chat.h @@ -36,6 +36,7 @@ namespace Actions decHandler(scrollChatUp); decHandler(scrollChatDown); decHandler(msg); + decHandler(msgText); decHandler(msg2); decHandler(query); decHandler(clearChatTab); -- cgit v1.2.3-60-g2f50