Store default client id in credentials.hpp

This commit is contained in:
Rasmus Karlsson 2017-08-19 15:29:36 +02:00
parent 8b40393023
commit 3f8c025e64
4 changed files with 13 additions and 6 deletions

10
src/credentials.hpp Normal file
View file

@ -0,0 +1,10 @@
#pragma once
namespace chatterino {
inline QByteArray getDefaultClientID()
{
return QByteArray("7ue61iz46fz11y3cugd0l3tawb4taal");
}
} // namespace chatterino

View file

@ -25,8 +25,6 @@ using namespace chatterino::messages;
namespace chatterino {
const QString IrcManager::defaultClientId("7ue61iz46fz11y3cugd0l3tawb4taal");
IrcManager::IrcManager(ChannelManager &_channelManager, Resources &_resources,
EmoteManager &_emoteManager, WindowManager &_windowManager)
: channelManager(_channelManager)

View file

@ -30,8 +30,6 @@ public:
IrcManager(ChannelManager &_channelManager, Resources &_resources, EmoteManager &_emoteManager,
WindowManager &_windowManager);
static const QString defaultClientId;
void connect();
void disconnect();

View file

@ -1,5 +1,6 @@
#include "widgets/accountpopup.hpp"
#include "channel.hpp"
#include "credentials.hpp"
#include "ui_accountpopupform.h"
#include <QDebug>
@ -42,7 +43,7 @@ void AccountPopupWidget::getUserId()
QNetworkRequest req(nameUrl);
req.setRawHeader(QByteArray("Accept"), QByteArray("application/vnd.twitchtv.v5+json"));
req.setRawHeader(QByteArray("Client-ID"), QByteArray("7ue61iz46fz11y3cugd0l3tawb4taal"));
req.setRawHeader(QByteArray("Client-ID"), getDefaultClientID());
static auto manager = new QNetworkAccessManager();
auto *reply = manager->get(req);
@ -66,7 +67,7 @@ void AccountPopupWidget::getUserData()
QNetworkRequest req(idUrl);
req.setRawHeader(QByteArray("Accept"), QByteArray("application/vnd.twitchtv.v5+json"));
req.setRawHeader(QByteArray("Client-ID"), QByteArray("7ue61iz46fz11y3cugd0l3tawb4taal"));
req.setRawHeader(QByteArray("Client-ID"), getDefaultClientID());
static auto manager = new QNetworkAccessManager();
auto *reply = manager->get(req);