mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Removed ability to save files with ttl.
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -216,7 +216,7 @@ void AddSaveDocumentAction(
|
||||
HistoryItem *item,
|
||||
not_null<DocumentData*> document,
|
||||
not_null<ListWidget*> 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<HistoryItem*> item,
|
||||
not_null<DocumentData*> document,
|
||||
not_null<Window::SessionController*> 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<HistoryItem*> item) {
|
||||
return {};
|
||||
}
|
||||
|
||||
bool ItemHasTtl(HistoryItem *item) {
|
||||
return (item && item->media())
|
||||
? (item->media()->ttlSeconds() > 0)
|
||||
: false;
|
||||
}
|
||||
|
||||
} // namespace HistoryView
|
||||
|
||||
@@ -110,4 +110,6 @@ void AddEmojiPacksAction(
|
||||
|
||||
[[nodiscard]] TextWithEntities TransribedText(not_null<HistoryItem*> item);
|
||||
|
||||
[[nodiscard]] bool ItemHasTtl(HistoryItem *item);
|
||||
|
||||
} // namespace HistoryView
|
||||
|
||||
Reference in New Issue
Block a user