Implement an advanced method of adding a user to chatterino.
You can now switch between multiple users in the settings dialog. (Requires a restart for reconnecting etc)
This commit is contained in:
@@ -67,9 +67,24 @@ twitch::TwitchUser &AccountManager::getTwitchUser()
|
||||
return this->getTwitchAnon();
|
||||
}
|
||||
|
||||
std::string currentUser = pajlada::Settings::Setting<std::string>::get("/accounts/current");
|
||||
|
||||
QString currentUsername = QString::fromStdString(currentUser);
|
||||
|
||||
for (auto &user : this->twitchUsers) {
|
||||
if (user.getUserName() == currentUsername) {
|
||||
return user;
|
||||
}
|
||||
}
|
||||
|
||||
return this->twitchUsers.front();
|
||||
}
|
||||
|
||||
void AccountManager::setCurrentTwitchUser(const QString &username)
|
||||
{
|
||||
pajlada::Settings::Setting<std::string>::set("/accounts/current", username.toStdString());
|
||||
}
|
||||
|
||||
std::vector<twitch::TwitchUser> AccountManager::getTwitchUsers()
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(this->twitchUsersMutex);
|
||||
|
||||
Reference in New Issue
Block a user