diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-02-03 15:37:13 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-02-03 15:37:13 +0300 |
commit | d155816b5c271a0ed549e19128a54ef2f4a7a72a (patch) | |
tree | 51b700f704b08db9eaf6f19cb8caf0be5649fdfd | |
parent | e6977ace705cea79b5661ca766ae07dd435f0ef6 (diff) | |
download | mv-d155816b5c271a0ed549e19128a54ef2f4a7a72a.tar.gz mv-d155816b5c271a0ed549e19128a54ef2f4a7a72a.tar.bz2 mv-d155816b5c271a0ed549e19128a54ef2f4a7a72a.tar.xz mv-d155816b5c271a0ed549e19128a54ef2f4a7a72a.zip |
Improve trade spam filterring.
If trade filter move text to trade tab,
in previous tab for author it will leave message about moving.
In trade tab moved text will be with prefix "Moved: "
-rw-r--r-- | src/gui/windows/chatwindow.cpp | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp index 0934be0ff..940eb75e5 100644 --- a/src/gui/windows/chatwindow.cpp +++ b/src/gui/windows/chatwindow.cpp @@ -1537,18 +1537,25 @@ bool ChatWindow::resortChatLog(std::string line, std::string prefix; if (!channel.empty()) + { prefix = std::string("##3").append(channel).append("##0"); - - if (findI(line, mTradeFilter) != std::string::npos) + } + else if (tradeChatTab && + findI(line, mTradeFilter) != std::string::npos) { - if (tradeChatTab) + tradeChatTab->chatLog(std::string("##S") + _("Moved: ") + line, + own, + ignoreRecord, + tryRemoveColors); + if (own == ChatMsgType::BY_PLAYER) { - tradeChatTab->chatLog(prefix + line, - own, - ignoreRecord, - tryRemoveColors); + own = ChatMsgType::BY_SERVER; + line = _("Your message was moved to trade tab"); + } + else + { + return false; } - return false; } size_t idx2 = line.find(": "); |