From bf5337259d7528d0a40a6241eab8134097cf78c7 Mon Sep 17 00:00:00 2001 From: AlexeyZavar Date: Thu, 22 Feb 2024 22:59:22 +0300 Subject: [PATCH] fix: message shot replies in topics --- Telegram/SourceFiles/ayu/ayu_settings.cpp | 4 ++-- .../ayu/features/messageshot/message_shot.cpp | 24 ++++++++++++------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/Telegram/SourceFiles/ayu/ayu_settings.cpp b/Telegram/SourceFiles/ayu/ayu_settings.cpp index 21ecc27ccbf224..7c02857ad6212d 100644 --- a/Telegram/SourceFiles/ayu/ayu_settings.cpp +++ b/Telegram/SourceFiles/ayu/ayu_settings.cpp @@ -215,7 +215,7 @@ AyuGramSettings::AyuGramSettings() { simpleQuotesAndReplies = true; deletedMark = "🧹"; editedMark = Core::IsAppLaunched() ? tr::lng_edited(tr::now) : QString("edited"); - recentStickersCount = 50; + recentStickersCount = 100; // context menu items // 0 - hide @@ -227,7 +227,7 @@ AyuGramSettings::AyuGramSettings() { showUserMessagesInContextMenu = 2; showMessageDetailsInContextMenu = 2; - showLReadToggleInDrawer = true; + showLReadToggleInDrawer = false; showSReadToggleInDrawer = true; showGhostToggleInDrawer = true; showStreamerToggleInDrawer = false; diff --git a/Telegram/SourceFiles/ayu/features/messageshot/message_shot.cpp b/Telegram/SourceFiles/ayu/features/messageshot/message_shot.cpp index 218c62ec25462e..ef107ff7819f98 100644 --- a/Telegram/SourceFiles/ayu/features/messageshot/message_shot.cpp +++ b/Telegram/SourceFiles/ayu/features/messageshot/message_shot.cpp @@ -15,6 +15,7 @@ #include "data/data_cloud_themes.h" #include "data/data_peer.h" #include "data/data_session.h" +#include "history/history.h" #include "history/history_inner_widget.h" #include "history/history_item.h" #include "history/view/history_view_element.h" @@ -150,7 +151,8 @@ class MessageShotDelegate final : public HistoryView::DefaultElementDelegate MessageShotDelegate( not_null parent, not_null st, - Fn update); + Fn update, + bool isTopic); bool elementAnimationsPaused() override; not_null elementPathShiftGradient() override; @@ -160,14 +162,17 @@ class MessageShotDelegate final : public HistoryView::DefaultElementDelegate private: const not_null _parent; const std::unique_ptr _pathGradient; + HistoryView::Context _context; }; MessageShotDelegate::MessageShotDelegate( not_null parent, not_null st, - Fn update) + Fn update, + bool isTopic) : _parent(parent) , _pathGradient(HistoryView::MakePathShiftGradient(st, update)) { + _context = isTopic ? HistoryView::Context::Replies : HistoryView::Context::AdminLog; } bool MessageShotDelegate::elementAnimationsPaused() { @@ -255,12 +260,14 @@ QImage Make(not_null box, const ShotConfig &config) { takingShot = true; - auto delegate = std::make_unique(box, - st.get(), - [=] - { - box->update(); - }); + auto delegate = std::make_unique( + box, + st.get(), + [=] + { + box->update(); + }, + messages.front()->history()->asTopic()); // remove deleted messages messages.erase( @@ -413,4 +420,5 @@ void Wrapper(not_null widget) { auto box = Box(config); Ui::show(std::move(box)); } + }