2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

New structs for media autodownload settings.

This commit is contained in:
John Preston
2018-11-30 16:49:30 +04:00
parent 8708a001c7
commit e3cc8652e4
14 changed files with 542 additions and 88 deletions

View File

@@ -351,12 +351,10 @@ void RemoteSource::automaticLoad(
Data::FileOrigin origin,
const HistoryItem *item) {
if (_loader != CancelledFileLoader && item) {
bool loadFromCloud = false;
if (item->history()->peer->isUser()) {
loadFromCloud = !(cAutoDownloadPhoto() & dbiadNoPrivate);
} else {
loadFromCloud = !(cAutoDownloadPhoto() & dbiadNoGroups);
}
const auto loadFromCloud = Data::AutoDownload::Should(
Auth().settings().autoDownload(),
item->history()->peer,
this);
if (_loader) {
if (loadFromCloud) _loader->permitLoadFromCloud();
@@ -656,12 +654,10 @@ void DelayedStorageSource::automaticLoad(
const HistoryItem *item) {
if (_location.isNull()) {
if (!_loadCancelled && item) {
bool loadFromCloud = false;
if (item->history()->peer->isUser()) {
loadFromCloud = !(cAutoDownloadPhoto() & dbiadNoPrivate);
} else {
loadFromCloud = !(cAutoDownloadPhoto() & dbiadNoGroups);
}
const auto loadFromCloud = Data::AutoDownload::Should(
Auth().settings().autoDownload(),
item->history()->peer,
this);
if (_loadRequested) {
if (loadFromCloud) _loadFromCloud = loadFromCloud;