refactor: Move TwitchBadges to Application (#5096)
* refactor: Move TwitchBadges to Application * refactor: Use named initializers * refactor: Use `empty()` instead of `size() > 0` * refactor: use emplace instead of push into the callback queue
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
#include "controllers/notifications/NotificationController.hpp"
|
||||
#include "controllers/sound/ISoundController.hpp"
|
||||
#include "providers/seventv/SeventvAPI.hpp"
|
||||
#include "providers/twitch/TwitchBadges.hpp"
|
||||
#include "singletons/ImageUploader.hpp"
|
||||
#ifdef CHATTERINO_HAVE_PLUGINS
|
||||
# include "controllers/plugins/PluginController.hpp"
|
||||
@@ -133,6 +134,7 @@ Application::Application(Settings &_settings, const Paths &paths,
|
||||
, sound(&this->emplace<ISoundController>(makeSoundController(_settings)))
|
||||
, twitchLiveController(&this->emplace<TwitchLiveController>())
|
||||
, twitchPubSub(new PubSub(TWITCH_PUBSUB_URL))
|
||||
, twitchBadges(new TwitchBadges)
|
||||
, logging(new Logging(_settings))
|
||||
#ifdef CHATTERINO_HAVE_PLUGINS
|
||||
, plugins(&this->emplace(new PluginController(paths)))
|
||||
@@ -153,6 +155,7 @@ Application::~Application() = default;
|
||||
void Application::fakeDtor()
|
||||
{
|
||||
this->twitchPubSub.reset();
|
||||
this->twitchBadges.reset();
|
||||
}
|
||||
|
||||
void Application::initialize(Settings &settings, const Paths &paths)
|
||||
@@ -320,6 +323,13 @@ ITwitchLiveController *Application::getTwitchLiveController()
|
||||
return this->twitchLiveController;
|
||||
}
|
||||
|
||||
TwitchBadges *Application::getTwitchBadges()
|
||||
{
|
||||
assert(this->twitchBadges);
|
||||
|
||||
return this->twitchBadges.get();
|
||||
}
|
||||
|
||||
ITwitchIrcServer *Application::getTwitch()
|
||||
{
|
||||
return this->twitch;
|
||||
|
||||
Reference in New Issue
Block a user