mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Sync local time with HTTP 'Date' header value.
This commit is contained in:
@@ -12,14 +12,14 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
namespace MTP {
|
||||
|
||||
struct ServiceWebRequest {
|
||||
ServiceWebRequest(not_null<QNetworkReply*> reply);
|
||||
ServiceWebRequest(ServiceWebRequest &&other);
|
||||
ServiceWebRequest &operator=(ServiceWebRequest &&other);
|
||||
~ServiceWebRequest();
|
||||
ServiceWebRequest(not_null<QNetworkReply*> reply);
|
||||
ServiceWebRequest(ServiceWebRequest &&other);
|
||||
ServiceWebRequest &operator=(ServiceWebRequest &&other);
|
||||
~ServiceWebRequest();
|
||||
|
||||
void destroy();
|
||||
void destroy();
|
||||
|
||||
QPointer<QNetworkReply> reply;
|
||||
QPointer<QNetworkReply> reply;
|
||||
|
||||
};
|
||||
|
||||
@@ -31,7 +31,9 @@ public:
|
||||
const std::string &ip,
|
||||
int port,
|
||||
bytes::const_span secret)> callback,
|
||||
Fn<void(TimeId)> timeCallback,
|
||||
const QString &phone);
|
||||
explicit SpecialConfigRequest(Fn<void(TimeId)> timeCallback);
|
||||
|
||||
private:
|
||||
enum class Type {
|
||||
@@ -46,6 +48,7 @@ private:
|
||||
void sendNextRequest();
|
||||
void performRequest(const Attempt &attempt);
|
||||
void requestFinished(Type type, not_null<QNetworkReply*> reply);
|
||||
void handleHeaderUnixtime(not_null<QNetworkReply*> reply);
|
||||
QByteArray finalizeRequest(not_null<QNetworkReply*> reply);
|
||||
void handleResponse(const QByteArray &bytes);
|
||||
bool decryptSimpleConfig(const QByteArray &bytes);
|
||||
@@ -55,6 +58,7 @@ private:
|
||||
const std::string &ip,
|
||||
int port,
|
||||
bytes::const_span secret)> _callback;
|
||||
Fn<void(TimeId)> _timeCallback;
|
||||
QString _phone;
|
||||
MTPhelp_ConfigSimple _simpleConfig;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user