summaryrefslogtreecommitdiff
path: root/src/gui/windows/chatwindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-02-03 16:01:15 +0300
committerAndrei Karas <akaras@inbox.ru>2016-02-03 16:01:15 +0300
commite183ff2fa9bfc3c9f61130209e191dae4ce2a886 (patch)
tree002f0512213543681e9ab710745bc72bfe227f89 /src/gui/windows/chatwindow.cpp
parentd155816b5c271a0ed549e19128a54ef2f4a7a72a (diff)
downloadmv-e183ff2fa9bfc3c9f61130209e191dae4ce2a886.tar.gz
mv-e183ff2fa9bfc3c9f61130209e191dae4ce2a886.tar.bz2
mv-e183ff2fa9bfc3c9f61130209e191dae4ce2a886.tar.xz
mv-e183ff2fa9bfc3c9f61130209e191dae4ce2a886.zip
Add option in settings to allow enable/disable sell spam filter.
Diffstat (limited to 'src/gui/windows/chatwindow.cpp')
-rw-r--r--src/gui/windows/chatwindow.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp
index 940eb75e5..84f24fa6c 100644
--- a/src/gui/windows/chatwindow.cpp
+++ b/src/gui/windows/chatwindow.cpp
@@ -116,6 +116,7 @@ ChatWindow::ChatWindow() :
mAutoHide(config.getBoolValue("autohideChat")),
mShowBattleEvents(config.getBoolValue("showBattleEvents")),
mShowAllLang(serverConfig.getValue("showAllLang", 0)),
+ mEnableTradeFilter(config.getBoolValue("enableTradeFilter")),
mTmpVisible(false)
{
setWindowName("Chat");
@@ -191,6 +192,7 @@ ChatWindow::ChatWindow() :
config.addListener("autohideChat", this);
config.addListener("showBattleEvents", this);
config.addListener("globalsFilter", this);
+ config.addListener("enableTradeFilter", this);
enableVisibleSound(true);
}
@@ -1540,7 +1542,8 @@ bool ChatWindow::resortChatLog(std::string line,
{
prefix = std::string("##3").append(channel).append("##0");
}
- else if (tradeChatTab &&
+ else if (mEnableTradeFilter &&
+ tradeChatTab &&
findI(line, mTradeFilter) != std::string::npos)
{
tradeChatTab->chatLog(std::string("##S") + _("Moved: ") + line,
@@ -2059,6 +2062,8 @@ void ChatWindow::optionChanged(const std::string &name)
mShowBattleEvents = config.getBoolValue("showBattleEvents");
else if (name == "globalsFilter")
parseGlobalsFilter();
+ else if (name == "enableTradeFilter")
+ mEnableTradeFilter = config.getBoolValue("enableTradeFilter");
}
void ChatWindow::mouseMoved(MouseEvent &event)