mirror-chatterino2/account.h

53 lines
733 B
C
Raw Normal View History

2017-01-04 15:12:31 +01:00
#ifndef ACCOUNT_H
#define ACCOUNT_H
2017-01-18 04:33:30 +01:00
#include <QString>
2017-01-04 15:12:31 +01:00
2017-01-18 21:30:23 +01:00
namespace chatterino {
2017-01-04 15:12:31 +01:00
class Account
{
public:
2017-01-18 04:52:47 +01:00
Account(QString username, QString oauthToken, QString oauthClient);
2017-01-04 15:12:31 +01:00
2017-01-11 18:52:09 +01:00
static const Account *
2017-01-18 04:33:30 +01:00
getAnon()
2017-01-11 18:52:09 +01:00
{
2017-01-18 04:33:30 +01:00
return &anon;
2017-01-04 15:12:31 +01:00
}
2017-01-11 18:52:09 +01:00
const QString &
2017-01-18 04:33:30 +01:00
getUsername() const
2017-01-11 18:52:09 +01:00
{
2017-01-18 04:33:30 +01:00
return username;
2017-01-04 15:12:31 +01:00
}
2017-01-11 18:52:09 +01:00
const QString &
2017-01-18 04:33:30 +01:00
getOauthToken() const
2017-01-11 18:52:09 +01:00
{
2017-01-18 04:33:30 +01:00
return oauthToken;
2017-01-04 15:12:31 +01:00
}
2017-01-11 18:52:09 +01:00
const QString &
2017-01-18 04:33:30 +01:00
getOauthClient() const
2017-01-11 18:52:09 +01:00
{
2017-01-18 04:33:30 +01:00
return oauthClient;
2017-01-04 15:12:31 +01:00
}
2017-01-11 18:52:09 +01:00
bool
2017-01-18 04:33:30 +01:00
isAnon() const
2017-01-11 18:52:09 +01:00
{
2017-01-18 04:33:30 +01:00
return username.startsWith("justinfan");
2017-01-04 15:12:31 +01:00
}
private:
2017-01-18 04:33:30 +01:00
static Account anon;
2017-01-04 15:12:31 +01:00
2017-01-18 04:33:30 +01:00
QString username;
QString oauthClient;
QString oauthToken;
2017-01-04 15:12:31 +01:00
};
2017-01-18 21:30:23 +01:00
}
2017-01-04 15:12:31 +01:00
2017-01-11 18:52:09 +01:00
#endif // ACCOUNT_H