summaryrefslogtreecommitdiff
path: root/src/gui/windows
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/windows')
-rw-r--r--src/gui/windows/chatwindow.cpp7
-rw-r--r--src/gui/windows/chatwindow.h1
2 files changed, 7 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)
diff --git a/src/gui/windows/chatwindow.h b/src/gui/windows/chatwindow.h
index bd0797e8c..0e1b6336d 100644
--- a/src/gui/windows/chatwindow.h
+++ b/src/gui/windows/chatwindow.h
@@ -416,6 +416,7 @@ class ChatWindow final : public Window,
bool mAutoHide;
bool mShowBattleEvents;
bool mShowAllLang;
+ bool mEnableTradeFilter;
bool mTmpVisible;
};