Refactor NetworkRequest class

Add followUser and unfollowUser methods to TwitchAccount
This commit is contained in:
Rasmus Karlsson
2018-07-07 11:08:57 +00:00
parent cada32edfd
commit 6a418e6e59
27 changed files with 835 additions and 669 deletions
+36
View File
@@ -0,0 +1,36 @@
#pragma once
#include "common/NetworkCommon.hpp"
#include <QNetworkRequest>
#include <functional>
class QNetworkReply;
namespace chatterino {
class NetworkResult;
struct NetworkData {
QNetworkRequest request_;
const QObject *caller_ = nullptr;
bool useQuickLoadCache_{};
NetworkReplyCreatedCallback onReplyCreated_;
NetworkErrorCallback onError_;
NetworkSuccessCallback onSuccess_;
NetworkRequestType requestType_ = NetworkRequestType::Get;
QByteArray payload_;
QString getHash();
void writeToCache(const QByteArray &bytes);
private:
QString hash_;
};
} // namespace chatterino