mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-04-19 13:46:47 +00:00
44 lines
914 B
C++
44 lines
914 B
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 "mtproto/sender.h"
|
|
|
|
class ApiWrap;
|
|
|
|
namespace Main {
|
|
class Session;
|
|
} // namespace Main
|
|
|
|
namespace Api {
|
|
|
|
class Premium final {
|
|
public:
|
|
explicit Premium(not_null<ApiWrap*> api);
|
|
|
|
void reload();
|
|
[[nodiscard]] rpl::producer<TextWithEntities> statusTextValue() const;
|
|
|
|
[[nodiscard]] int64 monthlyAmount() const;
|
|
[[nodiscard]] QString monthlyCurrency() const;
|
|
|
|
private:
|
|
const not_null<Main::Session*> _session;
|
|
MTP::Sender _api;
|
|
|
|
mtpRequestId _statusRequestId = 0;
|
|
std::optional<TextWithEntities> _statusText;
|
|
rpl::event_stream<TextWithEntities> _statusTextUpdates;
|
|
|
|
int64 _monthlyAmount = 0;
|
|
QString _monthlyCurrency;
|
|
|
|
};
|
|
|
|
} // namespace Api
|