mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
parent
fc47aa0da9
commit
5dcca4482a
1 changed files with 14 additions and 6 deletions
|
@ -2399,11 +2399,16 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) {
|
|||
}, &st::menuIconForward);
|
||||
}
|
||||
if (item->canDelete()) {
|
||||
_menu->addAction(Ui::DeleteMessageContextAction(
|
||||
_menu->menu(),
|
||||
[=] { deleteItem(itemId); },
|
||||
item->ttlDestroyAt(),
|
||||
[=] { _menu = nullptr; }));
|
||||
const auto callback = [=] { deleteItem(itemId); };
|
||||
if (item->isUploading()) {
|
||||
_menu->addAction(tr::lng_context_cancel_upload(tr::now), callback, &st::menuIconCancel);
|
||||
} else {
|
||||
_menu->addAction(Ui::DeleteMessageContextAction(
|
||||
_menu->menu(),
|
||||
callback,
|
||||
item->ttlDestroyAt(),
|
||||
[=] { _menu = nullptr; }));
|
||||
}
|
||||
}
|
||||
if (!blockSender && item->suggestReport()) {
|
||||
_menu->addAction(tr::lng_context_report_msg(tr::now), [=] {
|
||||
|
@ -2744,9 +2749,12 @@ void HistoryInner::copyContextImage(
|
|||
FullMsgId itemId) {
|
||||
const auto item = session().data().message(itemId);
|
||||
const auto media = photo->activeMediaView();
|
||||
const auto restricted = item
|
||||
? showCopyMediaRestriction(item)
|
||||
: IsServerMsgId(itemId.msg);
|
||||
if (photo->isNull() || !media || !media->loaded()) {
|
||||
return;
|
||||
} else if (!showCopyMediaRestriction(item)) {
|
||||
} else if (!restricted) {
|
||||
media->setToClipboard();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue