refactor: turn StreamerMode into a singleton(-like thing) (#5216)

This commit is contained in:
nerix
2024-03-01 21:12:02 +01:00
committed by GitHub
parent ea19c5c989
commit c1fa51242f
28 changed files with 386 additions and 210 deletions
+2 -4
View File
@@ -9,9 +9,9 @@
#include "messages/Selection.hpp"
#include "providers/colors/ColorProvider.hpp"
#include "singletons/Settings.hpp"
#include "singletons/StreamerMode.hpp"
#include "singletons/WindowManager.hpp"
#include "util/DebugCount.hpp"
#include "util/StreamerMode.hpp"
#include <QApplication>
#include <QDebug>
@@ -160,11 +160,9 @@ void MessageLayout::actuallyLayout(int width, MessageElementFlags flags)
if (this->message_->flags.has(MessageFlag::Timeout) ||
this->message_->flags.has(MessageFlag::Untimeout))
{
// This condition has been set up to execute isInStreamerMode() as the last thing
// as it could end up being expensive.
if (hideModerationActions ||
(getSettings()->streamerModeHideModActions &&
isInStreamerMode()))
getIApp()->getStreamerMode()->isEnabled()))
{
continue;
}