From 0384e13f0faf26e4b2716c3a16d2518bb23fba42 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 22 Mar 2013 13:43:19 +0300 Subject: Show channel messages in language tab. --- src/net/ea/chathandler.cpp | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) (limited to 'src/net/ea/chathandler.cpp') diff --git a/src/net/ea/chathandler.cpp b/src/net/ea/chathandler.cpp index 3a2c6ec2e..0118e5071 100644 --- a/src/net/ea/chathandler.cpp +++ b/src/net/ea/chathandler.cpp @@ -268,12 +268,13 @@ void ChatHandler::processBeingChat(Net::MessageIn &msg, const bool channels) if (!being) return; + std::string channel; if (channels) { chatMsgLength -= 3; - msg.readInt8(); // channel - msg.readInt8(); // channel - msg.readInt8(); // channel + channel = msg.readInt8(); + channel += msg.readInt8(); + channel += msg.readInt8(); } if (chatMsgLength <= 0) @@ -307,7 +308,7 @@ void ChatHandler::processBeingChat(Net::MessageIn &msg, const bool channels) PlayerRelation::SPEECH_LOG) && chatWindow) { chatWindow->resortChatLog(removeColors(sender_name) - .append(" : ").append(chatMsg), BY_OTHER); + .append(" : ").append(chatMsg), BY_OTHER, channel, false, true); } if (player_relations.hasPermission(sender_name, @@ -321,12 +322,13 @@ void ChatHandler::processChat(Net::MessageIn &msg, bool normalChat, bool channels) { int chatMsgLength = msg.readInt16() - 4; + std::string channel; if (channels) { chatMsgLength -= 3; - msg.readInt8(); // channel - msg.readInt8(); // channel - msg.readInt8(); // channel + channel = msg.readInt8(); + channel += msg.readInt8(); + channel += msg.readInt8(); } if (chatMsgLength <= 0) return; @@ -337,13 +339,19 @@ void ChatHandler::processChat(Net::MessageIn &msg, bool normalChat, if (normalChat) { if (chatWindow) - chatWindow->resortChatLog(chatMsg, BY_PLAYER); + { + chatWindow->resortChatLog(chatMsg, BY_PLAYER, + channel, false, true); + } - const std::string senseStr = "You sense the following: "; - if (actorSpriteManager && !chatMsg.find(senseStr)) + if (channel.empty()) { - actorSpriteManager->parseLevels( - chatMsg.substr(senseStr.size())); + const std::string senseStr = "You sense the following: "; + if (actorSpriteManager && !chatMsg.find(senseStr)) + { + actorSpriteManager->parseLevels( + chatMsg.substr(senseStr.size())); + } } if (pos != std::string::npos) -- cgit v1.2.3-60-g2f50