summaryrefslogtreecommitdiff
path: root/src/net/eathena/chathandler.cpp
diff options
context:
space:
mode:
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