refactor: turn StreamerMode into a singleton(-like thing) (#5216)
This commit is contained in:
@@ -22,12 +22,12 @@
|
||||
#include "providers/twitch/TwitchMessageBuilder.hpp"
|
||||
#include "singletons/Resources.hpp"
|
||||
#include "singletons/Settings.hpp"
|
||||
#include "singletons/StreamerMode.hpp"
|
||||
#include "singletons/WindowManager.hpp"
|
||||
#include "util/ChannelHelpers.hpp"
|
||||
#include "util/FormatTime.hpp"
|
||||
#include "util/Helpers.hpp"
|
||||
#include "util/IrcHelpers.hpp"
|
||||
#include "util/StreamerMode.hpp"
|
||||
|
||||
#include <IrcMessage>
|
||||
#include <QLocale>
|
||||
@@ -931,7 +931,7 @@ void IrcMessageHandler::handleWhisperMessage(Communi::IrcMessage *ircMessage)
|
||||
|
||||
if (getSettings()->inlineWhispers &&
|
||||
!(getSettings()->streamerModeSuppressInlineWhispers &&
|
||||
isInStreamerMode()))
|
||||
getIApp()->getStreamerMode()->isEnabled()))
|
||||
{
|
||||
getApp()->twitch->forEachChannel(
|
||||
[&message, overrideFlags](ChannelPtr channel) {
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#include "util/DebugCount.hpp"
|
||||
#include "util/Helpers.hpp"
|
||||
#include "util/RapidjsonHelpers.hpp"
|
||||
#include "util/StreamerMode.hpp"
|
||||
|
||||
#include <QJsonArray>
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "providers/twitch/TwitchMessageBuilder.hpp"
|
||||
#include "singletons/Emotes.hpp"
|
||||
#include "singletons/Settings.hpp"
|
||||
#include "singletons/StreamerMode.hpp"
|
||||
#include "singletons/Toasts.hpp"
|
||||
#include "singletons/WindowManager.hpp"
|
||||
#include "util/Helpers.hpp"
|
||||
@@ -180,7 +181,7 @@ TwitchChannel::TwitchChannel(const QString &name)
|
||||
|
||||
// Notify on all channels with a ping sound
|
||||
if (getSettings()->notificationOnAnyChannel &&
|
||||
!(isInStreamerMode() &&
|
||||
!(getIApp()->getStreamerMode()->isEnabled() &&
|
||||
getSettings()->streamerModeSuppressLiveNotifications))
|
||||
{
|
||||
getIApp()->getNotifications()->playSound();
|
||||
|
||||
Reference in New Issue
Block a user