mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Removed ability to save files with ttl.
This commit is contained in:
parent
cee2961632
commit
e52fe9ddb0
3 changed files with 15 additions and 2 deletions
|
@ -2309,7 +2309,9 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) {
|
||||||
showContextInFolder(document);
|
showContextInFolder(document);
|
||||||
}, &st::menuIconShowInFolder);
|
}, &st::menuIconShowInFolder);
|
||||||
}
|
}
|
||||||
if (item && !hasCopyMediaRestriction(item)) {
|
if (item
|
||||||
|
&& !hasCopyMediaRestriction(item)
|
||||||
|
&& !HistoryView::ItemHasTtl(item)) {
|
||||||
HistoryView::AddSaveSoundForNotifications(
|
HistoryView::AddSaveSoundForNotifications(
|
||||||
_menu,
|
_menu,
|
||||||
item,
|
item,
|
||||||
|
|
|
@ -216,7 +216,7 @@ void AddSaveDocumentAction(
|
||||||
HistoryItem *item,
|
HistoryItem *item,
|
||||||
not_null<DocumentData*> document,
|
not_null<DocumentData*> document,
|
||||||
not_null<ListWidget*> list) {
|
not_null<ListWidget*> list) {
|
||||||
if (list->hasCopyMediaRestriction(item)) {
|
if (list->hasCopyMediaRestriction(item) || ItemHasTtl(item)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const auto origin = item ? item->fullId() : FullMsgId();
|
const auto origin = item ? item->fullId() : FullMsgId();
|
||||||
|
@ -1224,6 +1224,9 @@ void AddSaveSoundForNotifications(
|
||||||
not_null<HistoryItem*> item,
|
not_null<HistoryItem*> item,
|
||||||
not_null<DocumentData*> document,
|
not_null<DocumentData*> document,
|
||||||
not_null<Window::SessionController*> controller) {
|
not_null<Window::SessionController*> controller) {
|
||||||
|
if (ItemHasTtl(item)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const auto &ringtones = document->session().api().ringtones();
|
const auto &ringtones = document->session().api().ringtones();
|
||||||
if (document->size > ringtones.maxSize()) {
|
if (document->size > ringtones.maxSize()) {
|
||||||
return;
|
return;
|
||||||
|
@ -1521,4 +1524,10 @@ TextWithEntities TransribedText(not_null<HistoryItem*> item) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ItemHasTtl(HistoryItem *item) {
|
||||||
|
return (item && item->media())
|
||||||
|
? (item->media()->ttlSeconds() > 0)
|
||||||
|
: false;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace HistoryView
|
} // namespace HistoryView
|
||||||
|
|
|
@ -110,4 +110,6 @@ void AddEmojiPacksAction(
|
||||||
|
|
||||||
[[nodiscard]] TextWithEntities TransribedText(not_null<HistoryItem*> item);
|
[[nodiscard]] TextWithEntities TransribedText(not_null<HistoryItem*> item);
|
||||||
|
|
||||||
|
[[nodiscard]] bool ItemHasTtl(HistoryItem *item);
|
||||||
|
|
||||||
} // namespace HistoryView
|
} // namespace HistoryView
|
||||||
|
|
Loading…
Add table
Reference in a new issue