From a0fcf73b3be1c91982c052945d055ae1f10cd270 Mon Sep 17 00:00:00 2001 From: Neurotoxin001 <39812401+Neurotoxin001@users.noreply.github.com> Date: Sun, 29 Jun 2025 14:32:31 +0300 Subject: [PATCH] The "Hide" context menu action now hides every media item in an album instead of only the first one --- .../ayu/ui/context_menu/context_menu.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Telegram/SourceFiles/ayu/ui/context_menu/context_menu.cpp b/Telegram/SourceFiles/ayu/ui/context_menu/context_menu.cpp index f4778ee9c7..ba72d02040 100644 --- a/Telegram/SourceFiles/ayu/ui/context_menu/context_menu.cpp +++ b/Telegram/SourceFiles/ayu/ui/context_menu/context_menu.cpp @@ -206,15 +206,20 @@ void AddHideMessageAction(not_null menu, HistoryItem *item) { return; } - const auto history = item->history(); + const auto history = item->history(); + const auto owner = &history->owner(); menu->addAction( tr::ayu_ContextHideMessage(tr::now), [=]() { - item->destroy(); + const auto ids = owner->itemOrItsGroup(item); + for (const auto &fullId : ids) { + if (const auto current = owner->message(fullId)) { + current->destroy(); + AyuState::hide(current); + } + } history->requestChatListMessage(); - - AyuState::hide(item); }, &st::menuIconClear); }