2017-04-12 17:46:44 +02:00
|
|
|
#ifndef ACCOUNTMANAGER_H
|
|
|
|
#define ACCOUNTMANAGER_H
|
|
|
|
|
2017-04-18 02:29:32 +02:00
|
|
|
#include "twitch/twitchaccount.h"
|
2017-04-12 17:46:44 +02:00
|
|
|
|
2017-04-13 16:06:23 +02:00
|
|
|
#include <mutex>
|
2017-04-14 14:08:57 +02:00
|
|
|
#include <vector>
|
2017-04-13 16:06:23 +02:00
|
|
|
|
2017-04-12 17:46:44 +02:00
|
|
|
namespace chatterino {
|
|
|
|
|
|
|
|
class AccountManager
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static AccountManager &getInstance()
|
|
|
|
{
|
2017-04-19 15:25:05 +02:00
|
|
|
static AccountManager instance;
|
2017-04-12 17:46:44 +02:00
|
|
|
return instance;
|
|
|
|
}
|
|
|
|
|
2017-04-13 16:06:23 +02:00
|
|
|
twitch::TwitchUser &getTwitchAnon();
|
|
|
|
|
|
|
|
std::vector<twitch::TwitchUser> getTwitchUsers();
|
|
|
|
bool removeTwitchUser(const QString &userName);
|
|
|
|
void addTwitchUser(const twitch::TwitchUser &user);
|
2017-04-12 17:46:44 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
AccountManager();
|
|
|
|
|
2017-04-13 16:06:23 +02:00
|
|
|
twitch::TwitchUser _twitchAnon;
|
|
|
|
std::vector<twitch::TwitchUser> _twitchUsers;
|
|
|
|
std::mutex _twitchUsersMutex;
|
2017-04-12 17:46:44 +02:00
|
|
|
};
|
2017-04-14 17:52:22 +02:00
|
|
|
} // namespace chatterino
|
2017-04-12 17:46:44 +02:00
|
|
|
|
|
|
|
#endif // ACCOUNTMANAGER_H
|