From f6081db13f8939803c25950c0fc62743ae191809 Mon Sep 17 00:00:00 2001 From: ZavaruKitsu Date: Sun, 4 Feb 2024 15:26:43 +0300 Subject: [PATCH] fix: hide comments for posts --- .../SourceFiles/history/view/history_view_message.cpp | 8 +++++++- .../SourceFiles/history/view/media/history_view_gif.cpp | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/history/view/history_view_message.cpp b/Telegram/SourceFiles/history/view/history_view_message.cpp index 8012e7822..a9bede89c 100644 --- a/Telegram/SourceFiles/history/view/history_view_message.cpp +++ b/Telegram/SourceFiles/history/view/history_view_message.cpp @@ -1274,6 +1274,10 @@ void Message::paintCommentsButton( Painter &p, QRect &g, const PaintContext &context) const { + if (AyuFeatures::MessageShot::isTakingShot()) { + return; + } + if (!data()->repliesAreComments() && !data()->externalReply()) { return; } @@ -4056,7 +4060,9 @@ int Message::resizeContentGetHeight(int newWidth) { } if (item->repliesAreComments() || item->externalReply()) { - newHeight += st::historyCommentsButtonHeight; + if (!AyuFeatures::MessageShot::isTakingShot()) { + newHeight += st::historyCommentsButtonHeight; + } } else if (_comments) { _comments = nullptr; checkHeavyPart(); diff --git a/Telegram/SourceFiles/history/view/media/history_view_gif.cpp b/Telegram/SourceFiles/history/view/media/history_view_gif.cpp index f95705070..8f123ab3d 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_gif.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_gif.cpp @@ -713,7 +713,7 @@ void Gif::draw(Painter &p, const PaintContext &context) const { const auto skipDrawingSurrounding = context.skipDrawingParts == PaintContext::SkipDrawingParts::Surrounding; - if (!unwrapped && !skipDrawingSurrounding) { + if (!unwrapped && !skipDrawingSurrounding && !AyuFeatures::MessageShot::ignoreRender(AyuFeatures::MessageShot::RenderPart::Date)) { if (!isRound || !inWebPage) { drawCornerStatus(p, context, QPoint()); }