MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / request

Method request

Telegram/SourceFiles/api/api_statistics.cpp:206–236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204}
205
206rpl::producer<rpl::no_value, QString> Statistics::request() {
207 return [=](auto consumer) {
208 auto lifetime = rpl::lifetime();
209
210 if (!channel()->isMegagroup()) {
211 makeRequest(MTPstats_GetBroadcastStats(
212 MTP_flags(MTPstats_GetBroadcastStats::Flags(0)),
213 channel()->inputChannel()
214 )).done([=](const MTPstats_BroadcastStats &result) {
215 _channelStats = ChannelStatisticsFromTL(result.data());
216 consumer.put_done();
217 }).fail([=](const MTP::Error &error) {
218 consumer.put_error_copy(error.type());
219 }).send();
220 } else {
221 makeRequest(MTPstats_GetMegagroupStats(
222 MTP_flags(MTPstats_GetMegagroupStats::Flags(0)),
223 channel()->inputChannel()
224 )).done([=](const MTPstats_MegagroupStats &result) {
225 const auto &data = result.data();
226 _supergroupStats = SupergroupStatisticsFromTL(data);
227 channel()->owner().processUsers(data.vusers());
228 consumer.put_done();
229 }).fail([=](const MTP::Error &error) {
230 consumer.put_error_copy(error.type());
231 }).send();
232 }
233
234 return lifetime;
235 };
236}
237
238Statistics::GraphResult Statistics::requestZoom(
239 const QString &token,

Callers 2

requestBoostsMethod · 0.45
requestHistoryMethod · 0.45

Calls 15

MTP_flagsFunction · 0.85
ChannelStatisticsFromTLFunction · 0.85
qsFunction · 0.85
OffsetTokenClass · 0.85
IdFromMessageFunction · 0.85
PeerFromMessageFunction · 0.85
DateFromMessageFunction · 0.85
peerFromMTPFunction · 0.85
MTP_stringFunction · 0.85
StatisticalGraphFromTLFunction · 0.85

Tested by

no test coverage detected