diff options
Diffstat (limited to '')
-rw-r--r-- | packages/telegram-no-ads.patch | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/packages/telegram-no-ads.patch b/packages/telegram-no-ads.patch new file mode 100644 index 0000000..1b34920 --- /dev/null +++ b/packages/telegram-no-ads.patch @@ -0,0 +1,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; + } |