Enable minithumbnail
This commit is contained in:
parent
4cd31ceb93
commit
296c2bfb81
@ -79,6 +79,9 @@ bool need_update_dialog_photo_minithumbnail(const string &from, const string &to
|
||||
}
|
||||
|
||||
td_api::object_ptr<td_api::minithumbnail> get_minithumbnail_object(const string &packed) {
|
||||
if (G()->shared_config().get_option_boolean("disable_minithumbnails")) {
|
||||
return nullptr;
|
||||
}
|
||||
if (packed.size() < 3) {
|
||||
return nullptr;
|
||||
}
|
||||
@ -228,11 +231,23 @@ Variant<PhotoSize, string> get_photo_size(FileManager *file_manager, PhotoSizeSo
|
||||
case telegram_api::photoStrippedSize::ID: {
|
||||
auto size = move_tl_object_as<telegram_api::photoStrippedSize>(size_ptr);
|
||||
if (format != PhotoFormat::Jpeg) {
|
||||
LOG(ERROR) << "Receive unexpected JPEG minithumbnail in photo " << id << " from " << source << " of format "
|
||||
<< format;
|
||||
return std::move(res);
|
||||
if (G()->shared_config().get_option_boolean("disable_minithumbnails")) {
|
||||
LOG(DEBUG) << "Receive unexpected JPEG minithumbnail";
|
||||
} else {
|
||||
LOG(ERROR) << "Receive unexpected JPEG minithumbnail in photo " << id << " from " << source << " of format "
|
||||
<< format;
|
||||
}
|
||||
if (G()->shared_config().get_option_boolean("disable_minithumbnails")) {
|
||||
return std::string("");
|
||||
} else {
|
||||
return std::move(res);
|
||||
}
|
||||
}
|
||||
if (G()->shared_config().get_option_boolean("disable_minithumbnails")) {
|
||||
return std::string("");
|
||||
} else {
|
||||
return size->bytes_.as_slice().str();
|
||||
}
|
||||
return size->bytes_.as_slice().str();
|
||||
}
|
||||
case telegram_api::photoSizeProgressive::ID: {
|
||||
auto size = move_tl_object_as<telegram_api::photoSizeProgressive>(size_ptr);
|
||||
|
Loading…
Reference in New Issue
Block a user