From d0cdad7bf81a07ba4b2f13c73a65fe1c68bb702f Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 15 Dec 2013 20:56:12 +0300 Subject: fix multiline motd messages showing/hiding. --- src/net/ea/chathandler.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/net/ea/chathandler.cpp') diff --git a/src/net/ea/chathandler.cpp b/src/net/ea/chathandler.cpp index 7199d3b5c..a10bf931d 100644 --- a/src/net/ea/chathandler.cpp +++ b/src/net/ea/chathandler.cpp @@ -49,6 +49,7 @@ namespace Ea ChatHandler::ChatHandler() : mSentWhispers(), + mMotdTime(-1), mShowAllLang(serverConfig.getValue("showAllLang", 0)), mShowMotd(config.getBoolValue("showmotd")), mSkipping(true) @@ -367,15 +368,17 @@ void ChatHandler::processChat(Net::MessageIn &msg, const bool normalChat, } } - if (chatMsg.find(": ") == std::string::npos && !mShowMotd + if (pos == std::string::npos && !mShowMotd && mSkipping && channel.empty()) { // skip motd from "new" tmw server + if (mMotdTime == -1) + mMotdTime = cur_time + 1; + else if (mMotdTime == cur_time || mMotdTime < cur_time) + mSkipping = false; return; } - mSkipping = false; - if (pos != std::string::npos) chatMsg.erase(0, pos + 3); -- cgit v1.2.3-60-g2f50