summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-03-22 13:43:19 +0300
committerAndrei Karas <akaras@inbox.ru>2013-03-22 13:45:50 +0300
commit0384e13f0faf26e4b2716c3a16d2518bb23fba42 (patch)
tree96cf8a9b745995fa39580b7cbc93012013dd4085 /src/net
parent392b20563409d8f56fb9940c622a195f0ee0f7c7 (diff)
downloadplus-0384e13f0faf26e4b2716c3a16d2518bb23fba42.tar.gz
plus-0384e13f0faf26e4b2716c3a16d2518bb23fba42.tar.bz2
plus-0384e13f0faf26e4b2716c3a16d2518bb23fba42.tar.xz
plus-0384e13f0faf26e4b2716c3a16d2518bb23fba42.zip
Show channel messages in language tab.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/ea/chathandler.cpp32
1 files changed, 20 insertions, 12 deletions
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)