2023-04-26 20:05:12 +00:00
|
|
|
/*
|
|
|
|
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
|
|
|
|
|
2023-04-26 20:58:03 +00:00
|
|
|
#include "data/data_statistics.h"
|
2023-04-26 20:05:12 +00:00
|
|
|
#include "mtproto/sender.h"
|
|
|
|
|
|
|
|
class ApiWrap;
|
|
|
|
class PeerData;
|
|
|
|
|
|
|
|
namespace Api {
|
|
|
|
|
|
|
|
class Statistics final {
|
|
|
|
public:
|
|
|
|
explicit Statistics(not_null<ApiWrap*> api);
|
|
|
|
|
2023-04-26 20:58:03 +00:00
|
|
|
[[nodiscard]] rpl::producer<rpl::no_value, QString> request(
|
|
|
|
not_null<PeerData*> peer);
|
2023-09-28 22:47:51 +00:00
|
|
|
using GraphResult = rpl::producer<Data::StatisticalGraph, QString>;
|
|
|
|
[[nodiscard]] GraphResult requestZoom(
|
2023-07-27 04:03:53 +00:00
|
|
|
not_null<PeerData*> peer,
|
|
|
|
const QString &token,
|
|
|
|
float64 x);
|
2023-09-28 22:47:51 +00:00
|
|
|
[[nodiscard]] GraphResult requestMessage(
|
|
|
|
not_null<PeerData*> peer,
|
|
|
|
MsgId msgId);
|
2023-04-26 20:58:03 +00:00
|
|
|
|
|
|
|
[[nodiscard]] Data::ChannelStatistics channelStats() const;
|
2023-09-28 20:20:07 +00:00
|
|
|
[[nodiscard]] Data::SupergroupStatistics supergroupStats() const;
|
2023-04-26 20:05:12 +00:00
|
|
|
|
|
|
|
private:
|
2023-04-26 20:58:03 +00:00
|
|
|
Data::ChannelStatistics _channelStats;
|
2023-09-28 20:20:07 +00:00
|
|
|
Data::SupergroupStatistics _supergroupStats;
|
2023-04-26 20:05:12 +00:00
|
|
|
MTP::Sender _api;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Api
|