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