Change the way Twitch accounts are stored in AccountManager
This is done in a way which should simplify abstracting it to other types of accounts if needed in the future Remove comment about removing singletons - we're keeping them (and probably restoring some) IrcManager now updates its "account" reference automatically through the AccountManager.Twitch.userChanged-signal Remove unused IrcManager getUser-method IrcManager::beginConnecting is no longer called asynchronously. This might want to be reverted in a more controlled asynchronous manner. User Accounts are now stored as Shared Pointers instead of using references/copies everywhere
This commit is contained in:
+2
-5
@@ -44,8 +44,7 @@ public:
|
||||
void joinChannel(const QString &channelName);
|
||||
void partChannel(const QString &channelName);
|
||||
|
||||
const twitch::TwitchUser &getUser() const;
|
||||
void setUser(const twitch::TwitchUser &account);
|
||||
void setUser(std::shared_ptr<twitch::TwitchUser> account);
|
||||
|
||||
pajlada::Signals::Signal<Communi::IrcPrivateMessage *> onPrivateMessage;
|
||||
|
||||
@@ -56,9 +55,7 @@ public:
|
||||
|
||||
private:
|
||||
// variables
|
||||
twitch::TwitchUser account;
|
||||
|
||||
pajlada::Settings::Setting<std::string> currentUser;
|
||||
std::shared_ptr<twitch::TwitchUser> account = nullptr;
|
||||
|
||||
std::shared_ptr<Communi::IrcConnection> writeConnection = nullptr;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user