2023-10-19 15:25:51 +02:00
|
|
|
//
|
|
|
|
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
|
|
|
|
//
|
|
|
|
// 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
|
|
|
|
|
2023-10-19 15:38:40 +02:00
|
|
|
#include "td/telegram/DialogBoostLinkInfo.h"
|
|
|
|
#include "td/telegram/DialogId.h"
|
|
|
|
#include "td/telegram/td_api.h"
|
|
|
|
|
2023-10-19 15:25:51 +02:00
|
|
|
#include "td/actor/actor.h"
|
|
|
|
|
|
|
|
#include "td/utils/common.h"
|
2023-10-19 15:38:40 +02:00
|
|
|
#include "td/utils/Promise.h"
|
|
|
|
#include "td/utils/Slice.h"
|
2023-10-19 15:25:51 +02:00
|
|
|
|
|
|
|
namespace td {
|
|
|
|
|
|
|
|
class Td;
|
|
|
|
|
|
|
|
class BoostManager final : public Actor {
|
|
|
|
public:
|
|
|
|
BoostManager(Td *td, ActorShared<> parent);
|
|
|
|
|
2023-10-21 00:24:25 +02:00
|
|
|
void get_boost_slots(Promise<td_api::object_ptr<td_api::chatBoostSlots>> &&promise);
|
|
|
|
|
2023-10-19 15:38:40 +02:00
|
|
|
void get_dialog_boost_status(DialogId dialog_id, Promise<td_api::object_ptr<td_api::chatBoostStatus>> &&promise);
|
|
|
|
|
2023-10-21 00:41:05 +02:00
|
|
|
void boost_dialog(DialogId dialog_id, vector<int32> slot_ids,
|
|
|
|
Promise<td_api::object_ptr<td_api::chatBoostSlots>> &&promise);
|
2023-10-19 15:38:40 +02:00
|
|
|
|
|
|
|
Result<std::pair<string, bool>> get_dialog_boost_link(DialogId dialog_id);
|
|
|
|
|
|
|
|
void get_dialog_boost_link_info(Slice url, Promise<DialogBoostLinkInfo> &&promise);
|
|
|
|
|
|
|
|
td_api::object_ptr<td_api::chatBoostLinkInfo> get_chat_boost_link_info_object(const DialogBoostLinkInfo &info) const;
|
|
|
|
|
2023-10-20 14:28:59 +02:00
|
|
|
void get_dialog_boosts(DialogId dialog_id, bool only_gift_codes, const string &offset, int32 limit,
|
2023-10-19 15:38:40 +02:00
|
|
|
Promise<td_api::object_ptr<td_api::foundChatBoosts>> &&promise);
|
|
|
|
|
2023-10-19 15:25:51 +02:00
|
|
|
private:
|
|
|
|
void tear_down() final;
|
|
|
|
|
|
|
|
Td *td_;
|
|
|
|
ActorShared<> parent_;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace td
|