summaryrefslogtreecommitdiff
path: root/src/net/ea/chathandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-11-03 12:22:27 +0300
committerAndrei Karas <akaras@inbox.ru>2013-11-03 12:22:27 +0300
commita7f5cb51379d7e2062c4732cd00bf975319987d3 (patch)
treef38d4a772612cf7d7cc33a478a96e9dd911efeb1 /src/net/ea/chathandler.cpp
parentbd7821e9648186abf1fa06c6ded9e61755b1d369 (diff)
downloadplus-a7f5cb51379d7e2062c4732cd00bf975319987d3.tar.gz
plus-a7f5cb51379d7e2062c4732cd00bf975319987d3.tar.bz2
plus-a7f5cb51379d7e2062c4732cd00bf975319987d3.tar.xz
plus-a7f5cb51379d7e2062c4732cd00bf975319987d3.zip
fix motd message show/hide on "new" tmw server.
Diffstat (limited to 'src/net/ea/chathandler.cpp')
-rw-r--r--src/net/ea/chathandler.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/net/ea/chathandler.cpp b/src/net/ea/chathandler.cpp
index deaef6984..0c34291c4 100644
--- a/src/net/ea/chathandler.cpp
+++ b/src/net/ea/chathandler.cpp
@@ -48,7 +48,8 @@ namespace Ea
ChatHandler::ChatHandler() :
mSentWhispers(),
mShowAllLang(serverConfig.getValue("showAllLang", 0)),
- mShowMotd(config.getBoolValue("showmotd"))
+ mShowMotd(config.getBoolValue("showmotd")),
+ mSkipping(true)
{
}
@@ -311,7 +312,7 @@ void ChatHandler::processBeingChat(Net::MessageIn &msg,
}
void ChatHandler::processChat(Net::MessageIn &msg, const bool normalChat,
- const bool channels) const
+ const bool channels)
{
BLOCK_START("ChatHandler::processChat")
int chatMsgLength = msg.readInt16() - 4;
@@ -334,6 +335,15 @@ void ChatHandler::processChat(Net::MessageIn &msg, const bool normalChat,
if (normalChat)
{
+ if (chatMsg.find(": ") == std::string::npos && !mShowMotd
+ && mSkipping && channel.empty())
+ {
+ // skip motd from "new" tmw server
+ return;
+ }
+
+ mSkipping = true;
+
if (chatWindow)
{
chatWindow->resortChatLog(chatMsg, BY_PLAYER,