Add ignore_inline_thumbnails option.

GitOrigin-RevId: 5721f8d0fd0a0adc3ba2c65c1c4af35690bdf47a
This commit is contained in:
levlam 2018-06-24 23:48:48 +03:00
parent 231c00ed9f
commit 45af3f53db
2 changed files with 8 additions and 0 deletions

View File

@ -6681,6 +6681,9 @@ void Td::on_request(uint64 id, td_api::setOption &request) {
}
break;
case 'i':
if (set_boolean_option("ignore_inline_thumbnails")) {
return;
}
if (set_boolean_option("is_emulator")) {
return;
}

View File

@ -8,6 +8,7 @@
#include "td/telegram/telegram_api.h"
#include "td/telegram/ConfigShared.h"
#include "td/telegram/files/FileLoaderUtils.h"
#include "td/telegram/files/FileLocation.h"
#include "td/telegram/Global.h"
@ -1335,6 +1336,10 @@ bool FileManager::set_encryption_key(FileId file_id, FileEncryptionKey key) {
}
bool FileManager::set_content(FileId file_id, BufferSlice bytes) {
if (G()->shared_config().get_option_boolean("ignore_inline_thumbnails")) {
return false;
}
auto node = get_sync_file_node(file_id);
if (!node) {
return false;