summaryrefslogtreecommitdiff
path: root/src/net/eathena/chathandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-02-16 12:27:52 +0300
committerAndrei Karas <akaras@inbox.ru>2015-02-16 12:27:52 +0300
commit47d811c90a4655b69f1846c16150efebbfa4ccfa (patch)
tree6624874f4da16cb900fc7aa730e5b0ccde4a0c9f /src/net/eathena/chathandler.cpp
parent08fbe14b1b261b5652f90212fd268d371302e762 (diff)
downloadmanaverse-47d811c90a4655b69f1846c16150efebbfa4ccfa.tar.gz
manaverse-47d811c90a4655b69f1846c16150efebbfa4ccfa.tar.bz2
manaverse-47d811c90a4655b69f1846c16150efebbfa4ccfa.tar.xz
manaverse-47d811c90a4655b69f1846c16150efebbfa4ccfa.zip
Move processWhisperContinue from ea namespace into eathena and tmwa.
Diffstat (limited to 'src/net/eathena/chathandler.cpp')
-rw-r--r--src/net/eathena/chathandler.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/net/eathena/chathandler.cpp b/src/net/eathena/chathandler.cpp
index 3def53afd..5aa12c53a 100644
--- a/src/net/eathena/chathandler.cpp
+++ b/src/net/eathena/chathandler.cpp
@@ -25,11 +25,14 @@
#include "actormanager.h"
#include "being/localplayer.h"
+#include "being/playerrelations.h"
#include "gui/chatconsts.h"
#include "gui/windows/chatwindow.h"
+#include "gui/widgets/tabs/chat/chattab.h"
+
#include "net/mercenaryhandler.h"
#include "net/serverfeatures.h"
@@ -655,4 +658,29 @@ void ChatHandler::partChannel(const std::string &channel)
}
}
+void ChatHandler::processWhisperContinue(const std::string &nick,
+ std::string chatMsg)
+{
+ // ignoring future whisper messages
+ if (chatMsg.find("\302\202G") == 0 || chatMsg.find("\302\202A") == 0)
+ {
+ BLOCK_END("ChatHandler::processWhisper")
+ return;
+ }
+ // remove first unicode space if this is may be whisper command.
+ if (chatMsg.find("\302\202!") == 0)
+ chatMsg = chatMsg.substr(2);
+
+ if (nick != "Server")
+ {
+ if (player_relations.hasPermission(nick, PlayerRelation::WHISPER))
+ chatWindow->addWhisper(nick, chatMsg);
+ }
+ else if (localChatTab)
+ {
+ localChatTab->chatLog(chatMsg, ChatMsgType::BY_SERVER);
+ }
+ BLOCK_END("ChatHandler::processWhisper")
+}
+
} // namespace EAthena