mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
feat: don't destroy expiring voice messages
This commit is contained in:
parent
6d39a5f1d2
commit
59c2cbaabc
2 changed files with 7 additions and 4 deletions
|
@ -41,6 +41,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "ui/item_text_options.h"
|
#include "ui/item_text_options.h"
|
||||||
#include "lang/lang_keys.h"
|
#include "lang/lang_keys.h"
|
||||||
|
|
||||||
|
// AyuGram includes
|
||||||
|
#include "ayu/ayu_settings.h"
|
||||||
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
bool PeerCallKnown(not_null<PeerData*> peer) {
|
bool PeerCallKnown(not_null<PeerData*> peer) {
|
||||||
|
@ -811,5 +815,6 @@ void ClearMediaAsExpired(not_null<HistoryItem*> item) {
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] bool IsVoiceOncePlayable(not_null<HistoryItem*> item) {
|
[[nodiscard]] bool IsVoiceOncePlayable(not_null<HistoryItem*> item) {
|
||||||
return !item->out() && item->media()->ttlSeconds();
|
const auto settings = &AyuSettings::getInstance();
|
||||||
|
return !item->out() && item->media()->ttlSeconds() && !settings->saveDeletedMessages;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1550,9 +1550,7 @@ TextWithEntities TransribedText(not_null<HistoryItem*> item) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ItemHasTtl(HistoryItem *item) {
|
bool ItemHasTtl(HistoryItem *item) {
|
||||||
return (item && item->media())
|
return false; // AyuGram: allow downloading files with ttl
|
||||||
? (item->media()->ttlSeconds() > 0)
|
|
||||||
: false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace HistoryView
|
} // namespace HistoryView
|
||||||
|
|
Loading…
Add table
Reference in a new issue