2024-08-01 12:57:39 +02:00
|
|
|
//
|
|
|
|
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024
|
|
|
|
//
|
|
|
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
|
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
|
|
//
|
|
|
|
#pragma once
|
|
|
|
|
2024-08-01 13:13:48 +02:00
|
|
|
#include "td/telegram/telegram_api.h"
|
|
|
|
|
2024-08-01 12:57:39 +02:00
|
|
|
#include "td/actor/actor.h"
|
|
|
|
|
|
|
|
#include "td/utils/common.h"
|
2024-08-01 13:13:48 +02:00
|
|
|
#include "td/utils/Status.h"
|
2024-08-01 12:57:39 +02:00
|
|
|
|
|
|
|
namespace td {
|
|
|
|
|
|
|
|
class Td;
|
|
|
|
|
|
|
|
class PromoDataManager final : public Actor {
|
|
|
|
public:
|
|
|
|
PromoDataManager(Td *td, ActorShared<> parent);
|
|
|
|
|
2024-08-01 13:13:48 +02:00
|
|
|
void init();
|
|
|
|
|
|
|
|
void reload_promo_data();
|
|
|
|
|
2024-08-01 12:57:39 +02:00
|
|
|
private:
|
|
|
|
void tear_down() final;
|
|
|
|
|
2024-08-01 13:13:48 +02:00
|
|
|
void start_up() final;
|
|
|
|
|
|
|
|
void timeout_expired() final;
|
|
|
|
|
|
|
|
void on_get_promo_data(Result<telegram_api::object_ptr<telegram_api::help_PromoData>> r_promo_data, bool dummy);
|
|
|
|
|
|
|
|
void schedule_get_promo_data(int32 expires_in);
|
|
|
|
|
2024-08-01 12:57:39 +02:00
|
|
|
Td *td_;
|
|
|
|
ActorShared<> parent_;
|
2024-08-01 13:13:48 +02:00
|
|
|
|
|
|
|
bool is_inited_ = false;
|
|
|
|
bool reloading_promo_data_ = false;
|
|
|
|
bool need_reload_promo_data_ = false;
|
2024-08-01 12:57:39 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace td
|