Fix disable_minithumbnails
This commit is contained in:
parent
1ce823b0e6
commit
9c67d7a6b7
@ -401,10 +401,18 @@ Variant<PhotoSize, string> get_photo_size(FileManager *file_manager, PhotoSizeSo
|
||||
} else {
|
||||
LOG(ERROR) << "Receive unexpected JPEG minithumbnail in photo of format " << format;
|
||||
}
|
||||
if (G()->shared_config().get_option_boolean("disable_minithumbnails")) {
|
||||
return "";
|
||||
} else {
|
||||
return std::move(res);
|
||||
}
|
||||
}
|
||||
if (G()->shared_config().get_option_boolean("disable_minithumbnails")) {
|
||||
return "";
|
||||
} else {
|
||||
return size->bytes_.as_slice().str();
|
||||
}
|
||||
}
|
||||
case telegram_api::photoSizeProgressive::ID: {
|
||||
auto size = move_tl_object_as<telegram_api::photoSizeProgressive>(size_ptr);
|
||||
|
||||
@ -733,10 +741,14 @@ Photo get_photo(FileManager *file_manager, tl_object_ptr<telegram_api::photo> &&
|
||||
continue;
|
||||
}
|
||||
res.photos.push_back(std::move(size));
|
||||
} else {
|
||||
if (G()->shared_config().get_option_boolean("disable_minithumbnails")) {
|
||||
res.minithumbnail = "";
|
||||
} else {
|
||||
res.minithumbnail = std::move(photo_size.get<1>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (auto &size_ptr : photo->video_sizes_) {
|
||||
auto animation =
|
||||
|
@ -12,6 +12,7 @@
|
||||
|
||||
#include "td/telegram/files/FileManager.h"
|
||||
#include "td/telegram/SecretChatActor.h"
|
||||
#include "td/telegram/ConfigShared.h"
|
||||
#include "td/telegram/Td.h"
|
||||
|
||||
#include "td/utils/logging.h"
|
||||
@ -170,7 +171,11 @@ void VideoNotesManager::create_video_note(FileId file_id, string minithumbnail,
|
||||
} else {
|
||||
LOG(INFO) << "Receive wrong video note dimensions " << dimensions;
|
||||
}
|
||||
if (G()->shared_config().get_option_boolean("disable_minithumbnails")) {
|
||||
v->minithumbnail = "";
|
||||
} else {
|
||||
v->minithumbnail = std::move(minithumbnail);
|
||||
}
|
||||
v->thumbnail = std::move(thumbnail);
|
||||
on_get_video_note(std::move(v), replace);
|
||||
}
|
||||
|
@ -215,7 +215,11 @@ void VideosManager::create_video(FileId file_id, string minithumbnail, PhotoSize
|
||||
v->mime_type = std::move(mime_type);
|
||||
v->duration = max(duration, 0);
|
||||
v->dimensions = dimensions;
|
||||
if (G()->shared_config().get_option_boolean("disable_minithumbnails")) {
|
||||
v->minithumbnail = "";
|
||||
} else {
|
||||
v->minithumbnail = std::move(minithumbnail);
|
||||
}
|
||||
v->thumbnail = std::move(thumbnail);
|
||||
v->animated_thumbnail = std::move(animated_thumbnail);
|
||||
v->supports_streaming = supports_streaming;
|
||||
|
Loading…
Reference in New Issue
Block a user