From 53392d6e5de75e71d66009e7678a5b388f6e6264 Mon Sep 17 00:00:00 2001 From: AlexeyZavar Date: Tue, 4 Feb 2025 16:11:52 +0300 Subject: [PATCH] feat: bypass client-side restrictions & minor adjustments --- .../ayu/ui/settings/settings_ayu.cpp | 2 +- Telegram/SourceFiles/data/data_peer.cpp | 36 ++----------------- Telegram/SourceFiles/ui/chat/chat.style | 2 +- 3 files changed, 5 insertions(+), 35 deletions(-) diff --git a/Telegram/SourceFiles/ayu/ui/settings/settings_ayu.cpp b/Telegram/SourceFiles/ayu/ui/settings/settings_ayu.cpp index fc782a4e9..426be8141 100644 --- a/Telegram/SourceFiles/ayu/ui/settings/settings_ayu.cpp +++ b/Telegram/SourceFiles/ayu/ui/settings/settings_ayu.cpp @@ -1284,7 +1284,7 @@ void SetupRecentStickersLimitSlider(not_null container) { updateLabel(settings->recentStickersCount); slider->setPseudoDiscrete( - 100 + 1, + 200 + 1, // thx tg [=](int amount) { diff --git a/Telegram/SourceFiles/data/data_peer.cpp b/Telegram/SourceFiles/data/data_peer.cpp index eb54d5541..c04dd1ff8 100644 --- a/Telegram/SourceFiles/data/data_peer.cpp +++ b/Telegram/SourceFiles/data/data_peer.cpp @@ -92,49 +92,19 @@ UnavailableReason UnavailableReason::Sensitive() { QString UnavailableReason::Compute( not_null session, const std::vector &list) { - const auto &skip = IgnoredReasons(session); - auto &&filtered = ranges::views::all( - list - ) | ranges::views::filter([&](const Data::UnavailableReason &reason) { - return !reason.sensitive() - && !ranges::contains(skip, reason.reason); - }); - const auto first = filtered.begin(); - return (first != filtered.end()) ? first->text : QString(); + return {}; } bool UnavailableReason::IgnoreSensitiveMark( not_null session) { - return ranges::contains( - IgnoredReasons(session), - UnavailableReason::Sensitive().reason); + return true; } // We should get a full restriction in "{full}: {reason}" format and we // need to find an "-all" tag in {full}, otherwise ignore this restriction. std::vector UnavailableReason::Extract( const MTPvector *list) { - if (!list) { - return {}; - } - return ranges::views::all( - list->v - ) | ranges::views::filter([](const MTPRestrictionReason &restriction) { - return restriction.match([&](const MTPDrestrictionReason &data) { - const auto platform = data.vplatform().v; - return false -#ifdef OS_MAC_STORE - || (platform == "ios"_q) -#elif defined OS_WIN_STORE // OS_MAC_STORE - || (platform == "ms"_q) -#endif // OS_MAC_STORE || OS_WIN_STORE - || (platform == "all"_q); - }); - }) | ranges::views::transform([](const MTPRestrictionReason &restriction) { - return restriction.match([&](const MTPDrestrictionReason &data) { - return UnavailableReason{ qs(data.vreason()), qs(data.vtext()) }; - }); - }) | ranges::to_vector; + return {}; } bool ApplyBotMenuButton( diff --git a/Telegram/SourceFiles/ui/chat/chat.style b/Telegram/SourceFiles/ui/chat/chat.style index d8ad6d59c..5474c48df 100644 --- a/Telegram/SourceFiles/ui/chat/chat.style +++ b/Telegram/SourceFiles/ui/chat/chat.style @@ -172,7 +172,7 @@ maxMediaSize: 430px; maxStickerSize: 224px; maxAnimatedEmojiSize: 112px; maxGifSize: 320px; -maxVideoMessageSize: 320px; +maxVideoMessageSize: 360px; maxSignatureSize: 144px; maxWallPaperWidth: 160px; maxWallPaperHeight: 240px;