refactor: some Application & style things (#5561)
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user