summaryrefslogtreecommitdiff
path: root/src/gui/windows/chatwindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-02-03 15:37:13 +0300
committerAndrei Karas <akaras@inbox.ru>2016-02-03 15:37:13 +0300
commitd155816b5c271a0ed549e19128a54ef2f4a7a72a (patch)
tree51b700f704b08db9eaf6f19cb8caf0be5649fdfd /src/gui/windows/chatwindow.cpp
parente6977ace705cea79b5661ca766ae07dd435f0ef6 (diff)
downloadplus-d155816b5c271a0ed549e19128a54ef2f4a7a72a.tar.gz
plus-d155816b5c271a0ed549e19128a54ef2f4a7a72a.tar.bz2
plus-d155816b5c271a0ed549e19128a54ef2f4a7a72a.tar.xz
plus-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: "
Diffstat (limited to 'src/gui/windows/chatwindow.cpp')
-rw-r--r--src/gui/windows/chatwindow.cpp23
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(": ");