blob: 2a88cbf2fa64f87aa98665fe73fba785dda15086 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
diff --git i/Telegram/SourceFiles/data/components/sponsored_messages.cpp w/Telegram/SourceFiles/data/components/sponsored_messages.cpp
index a60d7c3fd..070694b64 100644
--- i/Telegram/SourceFiles/data/components/sponsored_messages.cpp
+++ w/Telegram/SourceFiles/data/components/sponsored_messages.cpp
@@ -185,39 +185,7 @@ bool SponsoredMessages::canHaveFor(not_null<History*> history) const {
}
void SponsoredMessages::request(not_null<History*> history, Fn<void()> done) {
- if (!canHaveFor(history)) {
- return;
- }
- auto &request = _requests[history];
- if (request.requestId || TooEarlyForRequest(request.lastReceived)) {
- return;
- }
- {
- const auto it = _data.find(history);
- if (it != end(_data)) {
- auto &list = it->second;
- // Don't rebuild currently displayed messages.
- const auto proj = [](const Entry &e) {
- return e.item != nullptr;
- };
- if (ranges::any_of(list.entries, proj)) {
- return;
- }
- }
- }
- const auto channel = history->peer->asChannel();
- Assert(channel != nullptr);
- request.requestId = _session->api().request(
- MTPchannels_GetSponsoredMessages(
- channel->inputChannel)
- ).done([=](const MTPmessages_sponsoredMessages &result) {
- parse(history, result);
- if (done) {
- done();
- }
- }).fail([=] {
- _requests.remove(history);
- }).send();
+ return;
}
void SponsoredMessages::parse(
|