mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-09-06 03:53:41 +02:00
The "Hide" context menu action now hides every media item in an album instead of only the first one
This commit is contained in:
parent
2250fe75c4
commit
a0fcf73b3b
1 changed files with 9 additions and 4 deletions
|
@ -206,15 +206,20 @@ void AddHideMessageAction(not_null<Ui::PopupMenu*> menu, HistoryItem *item) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto history = item->history();
|
const auto history = item->history();
|
||||||
|
const auto owner = &history->owner();
|
||||||
menu->addAction(
|
menu->addAction(
|
||||||
tr::ayu_ContextHideMessage(tr::now),
|
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();
|
history->requestChatListMessage();
|
||||||
|
|
||||||
AyuState::hide(item);
|
|
||||||
},
|
},
|
||||||
&st::menuIconClear);
|
&st::menuIconClear);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue