diff --git a/Telegram/SourceFiles/history/history_inner_widget.cpp b/Telegram/SourceFiles/history/history_inner_widget.cpp index da1d308750..353bb68707 100644 --- a/Telegram/SourceFiles/history/history_inner_widget.cpp +++ b/Telegram/SourceFiles/history/history_inner_widget.cpp @@ -2309,7 +2309,9 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { showContextInFolder(document); }, &st::menuIconShowInFolder); } - if (item && !hasCopyMediaRestriction(item)) { + if (item + && !hasCopyMediaRestriction(item) + && !HistoryView::ItemHasTtl(item)) { HistoryView::AddSaveSoundForNotifications( _menu, item, diff --git a/Telegram/SourceFiles/history/view/history_view_context_menu.cpp b/Telegram/SourceFiles/history/view/history_view_context_menu.cpp index 018423367e..22fcc710b7 100644 --- a/Telegram/SourceFiles/history/view/history_view_context_menu.cpp +++ b/Telegram/SourceFiles/history/view/history_view_context_menu.cpp @@ -216,7 +216,7 @@ void AddSaveDocumentAction( HistoryItem *item, not_null document, not_null list) { - if (list->hasCopyMediaRestriction(item)) { + if (list->hasCopyMediaRestriction(item) || ItemHasTtl(item)) { return; } const auto origin = item ? item->fullId() : FullMsgId(); @@ -1224,6 +1224,9 @@ void AddSaveSoundForNotifications( not_null item, not_null document, not_null controller) { + if (ItemHasTtl(item)) { + return; + } const auto &ringtones = document->session().api().ringtones(); if (document->size > ringtones.maxSize()) { return; @@ -1521,4 +1524,10 @@ TextWithEntities TransribedText(not_null item) { return {}; } +bool ItemHasTtl(HistoryItem *item) { + return (item && item->media()) + ? (item->media()->ttlSeconds() > 0) + : false; +} + } // namespace HistoryView diff --git a/Telegram/SourceFiles/history/view/history_view_context_menu.h b/Telegram/SourceFiles/history/view/history_view_context_menu.h index 53a45e36c1..4979a67891 100644 --- a/Telegram/SourceFiles/history/view/history_view_context_menu.h +++ b/Telegram/SourceFiles/history/view/history_view_context_menu.h @@ -110,4 +110,6 @@ void AddEmojiPacksAction( [[nodiscard]] TextWithEntities TransribedText(not_null item); +[[nodiscard]] bool ItemHasTtl(HistoryItem *item); + } // namespace HistoryView