refactor: turn StreamerMode into a singleton(-like thing) (#5216)
This commit is contained in:
@@ -11,10 +11,10 @@
|
||||
#include "messages/MessageElement.hpp"
|
||||
#include "providers/twitch/TwitchBadge.hpp"
|
||||
#include "singletons/Settings.hpp"
|
||||
#include "singletons/StreamerMode.hpp"
|
||||
#include "singletons/WindowManager.hpp"
|
||||
#include "util/Helpers.hpp"
|
||||
#include "util/Qt.hpp"
|
||||
#include "util/StreamerMode.hpp"
|
||||
|
||||
#include <QFileInfo>
|
||||
|
||||
@@ -204,7 +204,8 @@ void SharedMessageBuilder::triggerHighlights(
|
||||
const QString &channelName, bool playSound,
|
||||
const std::optional<QUrl> &customSoundUrl, bool windowAlert)
|
||||
{
|
||||
if (isInStreamerMode() && getSettings()->streamerModeMuteMentions)
|
||||
if (getIApp()->getStreamerMode()->isEnabled() &&
|
||||
getSettings()->streamerModeMuteMentions)
|
||||
{
|
||||
// We are in streamer mode with muting mention sounds enabled. Do nothing.
|
||||
return;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user