mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
42 lines
957 B
C++
42 lines
957 B
C++
#pragma once
|
|
|
|
#include "twitch/twitchuser.hpp"
|
|
|
|
#include <mutex>
|
|
#include <vector>
|
|
|
|
namespace chatterino {
|
|
|
|
class AccountManager
|
|
{
|
|
public:
|
|
static AccountManager &getInstance()
|
|
{
|
|
static AccountManager instance;
|
|
return instance;
|
|
}
|
|
|
|
twitch::TwitchUser &getTwitchAnon();
|
|
|
|
// Returns first user from twitchUsers, or twitchAnonymousUser if twitchUsers is empty
|
|
twitch::TwitchUser &getTwitchUser();
|
|
|
|
// Return a copy of the current available twitch users
|
|
std::vector<twitch::TwitchUser> getTwitchUsers();
|
|
|
|
// Remove twitch user with the given username
|
|
bool removeTwitchUser(const QString &userName);
|
|
|
|
// Add twitch user to the list of available twitch users
|
|
void addTwitchUser(const twitch::TwitchUser &user);
|
|
|
|
private:
|
|
AccountManager();
|
|
|
|
twitch::TwitchUser twitchAnonymousUser;
|
|
std::vector<twitch::TwitchUser> twitchUsers;
|
|
std::mutex twitchUsersMutex;
|
|
};
|
|
|
|
} // namespace chatterino
|