From b84c3ac3bee960df3ee839c21be11c8cf142a5e8 Mon Sep 17 00:00:00 2001 From: fourtf Date: Wed, 21 Aug 2019 00:41:48 +0200 Subject: [PATCH] Fixes #1220 Added setting do disable timeout stacking --- src/common/Channel.cpp | 2 +- src/common/Channel.hpp | 3 ++- src/widgets/settingspages/GeneralPage.cpp | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/common/Channel.cpp b/src/common/Channel.cpp index 516918f70..4fe403758 100644 --- a/src/common/Channel.cpp +++ b/src/common/Channel.cpp @@ -144,7 +144,7 @@ void Channel::addOrReplaceTimeout(MessagePtr message) if (!message->flags.has(MessageFlag::PubSub) && s->flags.has(MessageFlag::PubSub)) // { - addMessage = false; + addMessage = timeoutStackStyle == TimeoutStackStyle::DontStack; break; } diff --git a/src/common/Channel.hpp b/src/common/Channel.hpp index 409eb0f54..596560bd8 100644 --- a/src/common/Channel.hpp +++ b/src/common/Channel.hpp @@ -21,8 +21,9 @@ using MessageFlags = FlagsEnum; enum class TimeoutStackStyle : int { StackHard = 0, DontStackBeyondUserMessage = 1, + DontStack = 2, - Default = StackHard, + Default = DontStackBeyondUserMessage, }; class Channel : public std::enable_shared_from_this diff --git a/src/widgets/settingspages/GeneralPage.cpp b/src/widgets/settingspages/GeneralPage.cpp index c4288c696..28b717285 100644 --- a/src/widgets/settingspages/GeneralPage.cpp +++ b/src/widgets/settingspages/GeneralPage.cpp @@ -219,7 +219,8 @@ void GeneralPage::initLayout(SettingsLayout &layout) layout.addCheckbox("Hide moderation messages", s.hideModerationActions); layout.addCheckbox("Colorize gray nicknames", s.colorizeNicknames); layout.addDropdown("Timeout stacking style", - {"Stack", "Stack sparingly"}, s.timeoutStackStyle, + {"Stack", "Stack unless timed out", "Don't stack"}, + s.timeoutStackStyle, [](int index) { return index; }, [](auto args) { return args.index; }, false);