mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
b6d0776917
* Compile before push DansGame * Initialize them when they are needed, not on startup. This is THREAD-SAFE since C++11 * Changed user to account
37 lines
713 B
C++
37 lines
713 B
C++
#ifndef ACCOUNTMANAGER_H
|
|
#define ACCOUNTMANAGER_H
|
|
|
|
#include "twitch/twitchaccount.h"
|
|
|
|
#include <mutex>
|
|
#include <vector>
|
|
|
|
namespace chatterino {
|
|
|
|
class AccountManager
|
|
{
|
|
public:
|
|
static AccountManager &getInstance()
|
|
{
|
|
static AccountManager instance;
|
|
return instance;
|
|
}
|
|
|
|
twitch::TwitchUser &getTwitchAnon();
|
|
|
|
std::vector<twitch::TwitchUser> getTwitchUsers();
|
|
bool removeTwitchUser(const QString &userName);
|
|
void addTwitchUser(const twitch::TwitchUser &user);
|
|
|
|
private:
|
|
|
|
AccountManager();
|
|
|
|
twitch::TwitchUser _twitchAnon;
|
|
std::vector<twitch::TwitchUser> _twitchUsers;
|
|
std::mutex _twitchUsersMutex;
|
|
};
|
|
} // namespace chatterino
|
|
|
|
#endif // ACCOUNTMANAGER_H
|