2023-09-19 20:24:19 +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-09-19 20:40:29 +02:00
|
|
|
#include "td/telegram/ChannelId.h"
|
|
|
|
#include "td/telegram/DialogId.h"
|
|
|
|
#include "td/telegram/FullMessageId.h"
|
|
|
|
#include "td/telegram/net/DcId.h"
|
|
|
|
#include "td/telegram/td_api.h"
|
|
|
|
|
2023-09-19 20:24:19 +02:00
|
|
|
#include "td/actor/actor.h"
|
|
|
|
|
|
|
|
#include "td/utils/common.h"
|
2023-09-19 20:40:29 +02:00
|
|
|
#include "td/utils/Promise.h"
|
2023-09-19 20:24:19 +02:00
|
|
|
|
|
|
|
namespace td {
|
|
|
|
|
|
|
|
class Td;
|
|
|
|
|
|
|
|
class StatisticsManager final : public Actor {
|
|
|
|
public:
|
|
|
|
StatisticsManager(Td *td, ActorShared<> parent);
|
|
|
|
|
2023-09-19 20:40:29 +02:00
|
|
|
void get_channel_statistics(DialogId dialog_id, bool is_dark,
|
|
|
|
Promise<td_api::object_ptr<td_api::ChatStatistics>> &&promise);
|
|
|
|
|
|
|
|
void get_channel_message_statistics(FullMessageId full_message_id, bool is_dark,
|
|
|
|
Promise<td_api::object_ptr<td_api::messageStatistics>> &&promise);
|
|
|
|
|
|
|
|
void load_statistics_graph(DialogId dialog_id, string token, int64 x,
|
|
|
|
Promise<td_api::object_ptr<td_api::StatisticalGraph>> &&promise);
|
|
|
|
|
2023-09-19 20:24:19 +02:00
|
|
|
private:
|
|
|
|
void tear_down() final;
|
|
|
|
|
2023-09-19 20:40:29 +02:00
|
|
|
void send_get_channel_stats_query(DcId dc_id, ChannelId channel_id, bool is_dark,
|
|
|
|
Promise<td_api::object_ptr<td_api::ChatStatistics>> &&promise);
|
|
|
|
|
|
|
|
void send_get_channel_message_stats_query(DcId dc_id, FullMessageId full_message_id, bool is_dark,
|
|
|
|
Promise<td_api::object_ptr<td_api::messageStatistics>> &&promise);
|
|
|
|
|
|
|
|
void send_load_async_graph_query(DcId dc_id, string token, int64 x,
|
|
|
|
Promise<td_api::object_ptr<td_api::StatisticalGraph>> &&promise);
|
|
|
|
|
2023-09-19 20:24:19 +02:00
|
|
|
Td *td_;
|
|
|
|
ActorShared<> parent_;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace td
|