Слияние с tdesktop от 64ca5475f2 до тега v7.3.1 (7.2.10 beta, 7.3, 7.3.1).
- Версия 7.3.1 (7003001), BetaChannel 0, комментарий ZaStoGram сохранён.
- Обновлятор: оригинал убрал пакеты v1 (RSA), а наш Packer и Forgejo
выпускают именно их. v1 оставлен как UnpackUpdateV1 рядом с v2 и
использует новые проверенные распаковку и извлечение файлов.
- mtproto: исправления импорта авторизации из оригинала перенесены в нашу
структуру RequestRegistry; пути include новых файлов кошелька
приведены к нашей раскладке mtproto/.
- prepare.py: стадии оригинала (ucrt64, ffmpeg 8, openssl 3.5, libheif,
Rust, wallet-engine) с нашими skip-debug и patches_extra.
- lib_ui, lib_lottie: форки слиты с версиями из v7.3.1.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
63 lines
1.5 KiB
C++
63 lines
1.5 KiB
C++
/*
|
|
This file is part of Telegram Desktop,
|
|
the official desktop application for the Telegram messaging service.
|
|
|
|
For license and copyright information please follow this link:
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|
*/
|
|
#pragma once
|
|
|
|
#include "base/timer.h"
|
|
#include "gram/api/gram_api_request.h"
|
|
#include "mtproto/instance/sender.h"
|
|
|
|
namespace Main {
|
|
class Session;
|
|
} // namespace Main
|
|
|
|
namespace Wallet {
|
|
|
|
class Api final {
|
|
public:
|
|
explicit Api(not_null<Main::Session*> session);
|
|
~Api();
|
|
|
|
mtpRequestId request(
|
|
const Gram::HttpRequest &request,
|
|
Fn<void(const QByteArray &)> done,
|
|
Fn<void(const Gram::ApiError &)> fail);
|
|
[[nodiscard]] mtpRequestId requestStreamingUrl(
|
|
Fn<void(const QString &url, TimeId expires)> done,
|
|
Fn<void(const Gram::ApiError &)> fail);
|
|
void cancelRequest(mtpRequestId requestId);
|
|
|
|
[[nodiscard]] static bool IsTimeoutError(const Gram::ApiError &error);
|
|
|
|
|
|
[[nodiscard]] bool hasPendingRequests() const;
|
|
|
|
private:
|
|
struct Sent {
|
|
mtpRequestId id = 0;
|
|
crl::time deadline = 0;
|
|
QString endpoint;
|
|
Fn<void(const Gram::ApiError &)> fail;
|
|
};
|
|
|
|
[[nodiscard]] MTP::ShiftedDcId shiftedDcId() const;
|
|
[[nodiscard]] bool requestAnswered(mtpRequestId requestId);
|
|
void requestFinished();
|
|
void scheduleTimeoutCheck();
|
|
void checkTimeouts();
|
|
void checkIdleSession();
|
|
|
|
const not_null<Main::Session*> _session;
|
|
MTP::Sender _api;
|
|
base::Timer _killSessionTimer;
|
|
base::Timer _timeoutTimer;
|
|
int _pendingCount = 0;
|
|
std::vector<Sent> _sent;
|
|
|
|
};
|
|
|
|
} // namespace Wallet
|