about summary refs log tree commit diff
path: root/packages/telegram-no-ads.patch
blob: 1b34920ecb77af76bcd6e1d4ae20ba7bbfd5364a (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
diff --git i/Telegram/SourceFiles/data/components/sponsored_messages.cpp w/Telegram/SourceFiles/data/components/sponsored_messages.cpp
index 5ae9d8b2c..f116246b5 100644
--- i/Telegram/SourceFiles/data/components/sponsored_messages.cpp
+++ w/Telegram/SourceFiles/data/components/sponsored_messages.cpp
@@ -27,7 +27,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
 namespace Data {
 namespace {
 
-constexpr auto kRequestTimeLimit = 5 * 60 * crl::time(1000);
+constexpr auto kRequestTimeLimit = 9999999 * 60 * crl::time(1000);
 
 [[nodiscard]] bool TooEarlyForRequest(crl::time received) {
 	return (received > 0) && (received + kRequestTimeLimit > crl::now());
@@ -74,6 +74,9 @@ void SponsoredMessages::clearOldRequests() {
 
 SponsoredMessages::AppendResult SponsoredMessages::append(
 		not_null<History*> history) {
+	if (1) {
+		return;
+	}
 	if (isTopBarFor(history)) {
 		return SponsoredMessages::AppendResult::None;
 	}
@@ -110,6 +113,9 @@ void SponsoredMessages::inject(
 		MsgId injectAfterMsgId,
 		int betweenHeight,
 		int fallbackWidth) {
+	if (1) {
+		return;
+	}
 	if (!canHaveFor(history)) {
 		return;
 	}
@@ -210,24 +216,17 @@ void SponsoredMessages::inject(
 }
 
 bool SponsoredMessages::canHaveFor(not_null<History*> history) const {
-	if (history->peer->isChannel()) {
-		return true;
-	} else if (const auto user = history->peer->asUser()) {
-		return user->isBot();
-	}
 	return false;
 }
 
 bool SponsoredMessages::isTopBarFor(not_null<History*> history) const {
-	if (peerIsUser(history->peer->id)) {
-		if (const auto user = history->peer->asUser()) {
-			return user->isBot();
-		}
-	}
 	return false;
 }
 
 void SponsoredMessages::request(not_null<History*> history, Fn<void()> done) {
+	if (1) {
+		return;
+	}
 	if (!canHaveFor(history)) {
 		return;
 	}

Consider giving Nix/NixOS a try! <3