refactor: some Application & style things (#5561)

This commit is contained in:
pajlada
2024-08-25 15:33:07 +02:00
committed by GitHub
parent ac88730563
commit 627c735524
41 changed files with 733 additions and 678 deletions
+19
View File
@@ -1,6 +1,8 @@
#include "providers/twitch/PubSubManager.hpp"
#include "Application.hpp"
#include "common/QLogging.hpp"
#include "controllers/accounts/AccountController.hpp"
#include "providers/NetworkConfigurationProvider.hpp"
#include "providers/twitch/PubSubActions.hpp"
#include "providers/twitch/PubSubClient.hpp"
@@ -508,6 +510,23 @@ PubSub::~PubSub()
this->stop();
}
void PubSub::initialize()
{
this->start();
this->setAccount(getApp()->getAccounts()->twitch.getCurrent());
getApp()->getAccounts()->twitch.currentUserChanged.connect(
[this] {
this->unlistenChannelModerationActions();
this->unlistenAutomod();
this->unlistenLowTrustUsers();
this->unlistenChannelPointRewards();
this->setAccount(getApp()->getAccounts()->twitch.getCurrent());
},
boost::signals2::at_front);
}
void PubSub::setAccount(std::shared_ptr<TwitchAccount> account)
{
this->token_ = account->getOAuthToken();