summaryrefslogtreecommitdiff
path: root/src/net/eathena
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
parent08fbe14b1b261b5652f90212fd268d371302e762 (diff)
downloadplus-47d811c90a4655b69f1846c16150efebbfa4ccfa.tar.gz
plus-47d811c90a4655b69f1846c16150efebbfa4ccfa.tar.bz2
plus-47d811c90a4655b69f1846c16150efebbfa4ccfa.tar.xz
plus-47d811c90a4655b69f1846c16150efebbfa4ccfa.zip
Move processWhisperContinue from ea namespace into eathena and tmwa.
Diffstat (limited to 'src/net/eathena')
-rw-r--r--src/net/eathena/chathandler.cpp28
-rw-r--r--src/net/eathena/chathandler.h3
2 files changed, 31 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
diff --git a/src/net/eathena/chathandler.h b/src/net/eathena/chathandler.h
index e4a588fef..3b38c5a25 100644
--- a/src/net/eathena/chathandler.h
+++ b/src/net/eathena/chathandler.h
@@ -117,6 +117,9 @@ class ChatHandler final : public MessageHandler, public Ea::ChatHandler
static void processChatLeave(Net::MessageIn &msg);
static void processJoinChannel(Net::MessageIn &msg);
+
+ static void processWhisperContinue(const std::string &nick,
+ std::string chatMsg);
};
} // namespace EAthena