2017-06-07 10:09:24 +02:00
|
|
|
#pragma once
|
2017-04-12 17:46:44 +02:00
|
|
|
|
2018-02-04 16:33:46 +01:00
|
|
|
#include <QColor>
|
2017-04-12 17:46:44 +02:00
|
|
|
#include <QString>
|
|
|
|
|
2017-04-14 17:52:22 +02:00
|
|
|
namespace chatterino {
|
2018-02-05 15:11:50 +01:00
|
|
|
namespace providers {
|
2017-04-14 17:52:22 +02:00
|
|
|
namespace twitch {
|
2018-02-05 15:11:50 +01:00
|
|
|
class TwitchAccount
|
2017-04-12 17:46:44 +02:00
|
|
|
{
|
|
|
|
public:
|
2018-02-05 15:11:50 +01:00
|
|
|
TwitchAccount(const QString &username, const QString &oauthToken, const QString &oauthClient);
|
2017-04-12 17:46:44 +02:00
|
|
|
|
2018-02-05 15:11:50 +01:00
|
|
|
const QString &getUserName() const;
|
2017-04-12 17:46:44 +02:00
|
|
|
const QString &getOAuthToken() const;
|
|
|
|
const QString &getOAuthClient() const;
|
2018-02-05 15:11:50 +01:00
|
|
|
|
2017-09-23 19:23:10 +02:00
|
|
|
const QString &getUserId() const;
|
|
|
|
void setUserId(const QString &id);
|
2017-04-12 17:46:44 +02:00
|
|
|
|
2017-12-26 11:59:26 +01:00
|
|
|
// Attempts to update the users OAuth Client ID
|
|
|
|
// Returns true if the value has changed, otherwise false
|
|
|
|
bool setOAuthClient(const QString &newClientID);
|
|
|
|
|
|
|
|
// Attempts to update the users OAuth Token
|
|
|
|
// Returns true if the value has changed, otherwise false
|
|
|
|
bool setOAuthToken(const QString &newOAuthToken);
|
2017-12-19 15:09:54 +01:00
|
|
|
|
2017-04-12 17:46:44 +02:00
|
|
|
bool isAnon() const;
|
|
|
|
|
2018-02-04 16:33:46 +01:00
|
|
|
QColor color;
|
|
|
|
|
2017-04-12 17:46:44 +02:00
|
|
|
private:
|
2018-02-05 15:11:50 +01:00
|
|
|
QString oauthClient;
|
|
|
|
QString oauthToken;
|
|
|
|
QString userId;
|
|
|
|
QString userName;
|
2017-12-26 11:59:26 +01:00
|
|
|
const bool _isAnon;
|
2017-04-12 17:46:44 +02:00
|
|
|
};
|
2017-05-27 17:45:40 +02:00
|
|
|
} // namespace twitch
|
2018-02-05 15:11:50 +01:00
|
|
|
} // namespace providers
|
2017-05-27 17:45:40 +02:00
|
|
|
} // namespace chatterino
|