summarylogtreecommitdiffstats
path: root/remove-ad.patch
blob: 78ab5dd5b4de84e017f29a454b4c44e535ffefd3 (plain)
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
diff --color --unified --recursive --text 64Gram-1.0.23-full/Telegram/SourceFiles/data/data_sponsored_messages.cpp 64Gram-1.0.23-full-target/Telegram/SourceFiles/data/data_sponsored_messages.cpp
--- 64Gram-1.0.23-full/Telegram/SourceFiles/data/data_sponsored_messages.cpp	2022-03-09 07:28:56.767215500 +0800
+++ 64Gram-1.0.23-full-target/Telegram/SourceFiles/data/data_sponsored_messages.cpp	2022-03-12 21:00:46.424836547 +0800
@@ -86,36 +86,7 @@
 }
 
 void SponsoredMessages::request(not_null<History*> history) {
-	if (!canHaveFor(history) || history->peer->isMegagroup()) {
-		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);
-	}).fail([=] {
-		_requests.remove(history);
-	}).send();
+	return;
 }
 
 void SponsoredMessages::parse(