Fix merge
This commit is contained in:
parent
6bddb57999
commit
10bd3f0afc
@ -193,7 +193,7 @@ FileId AnimationsManager::on_get_animation(unique_ptr<Animation> new_animation,
|
||||
LOG(DEBUG) << "Animation " << file_id << " duration has changed";
|
||||
a->duration = new_animation->duration;
|
||||
}
|
||||
if (!G()->shared_config().get_option_boolean("disable_minithumbnails")) {
|
||||
if (!G()->get_option_boolean("disable_minithumbnails")) {
|
||||
if (a->minithumbnail != new_animation->minithumbnail) {
|
||||
a->minithumbnail = std::move(new_animation->minithumbnail);
|
||||
}
|
||||
@ -299,7 +299,7 @@ void AnimationsManager::create_animation(FileId file_id, string minithumbnail, P
|
||||
a->mime_type = std::move(mime_type);
|
||||
a->duration = max(duration, 0);
|
||||
a->dimensions = dimensions;
|
||||
if (!G()->shared_config().get_option_boolean("disable_minithumbnails")) {
|
||||
if (!G()->get_option_boolean("disable_minithumbnails")) {
|
||||
if (!td_->auth_manager_->is_bot()) {
|
||||
a->minithumbnail = std::move(minithumbnail);
|
||||
}
|
||||
|
@ -15,7 +15,6 @@
|
||||
#include "td/utils/common.h"
|
||||
#include "td/utils/tl_helpers.h"
|
||||
|
||||
#include "td/telegram/ConfigShared.h"
|
||||
|
||||
namespace td {
|
||||
|
||||
@ -63,7 +62,7 @@ FileId AnimationsManager::parse_animation(ParserT &parser) {
|
||||
|
||||
parse(animation->mime_type, parser);
|
||||
|
||||
if ( G()->shared_config().get_option_boolean("disable_document_filenames") && (
|
||||
if ( G()->get_option_boolean("disable_document_filenames") && (
|
||||
animation->mime_type.rfind("image/") == 0 ||
|
||||
animation->mime_type.rfind("video/") == 0 ||
|
||||
animation->mime_type.rfind("audio/") == 0)) {
|
||||
@ -75,7 +74,7 @@ FileId AnimationsManager::parse_animation(ParserT &parser) {
|
||||
if (parser.version() >= static_cast<int32>(Version::SupportMinithumbnails)) {
|
||||
string tmp_minithumbnail;
|
||||
parse(tmp_minithumbnail, parser);
|
||||
if (!G()->shared_config().get_option_boolean("disable_minithumbnails")) {
|
||||
if (!G()->get_option_boolean("disable_minithumbnails")) {
|
||||
animation->minithumbnail = tmp_minithumbnail;
|
||||
}
|
||||
}
|
||||
|
@ -15,7 +15,6 @@
|
||||
#include "td/utils/common.h"
|
||||
#include "td/utils/tl_helpers.h"
|
||||
|
||||
#include "td/telegram/ConfigShared.h"
|
||||
|
||||
namespace td {
|
||||
|
||||
@ -103,7 +102,7 @@ FileId AudiosManager::parse_audio(ParserT &parser) {
|
||||
if (has_file_name) {
|
||||
string tmp_filename;
|
||||
parse(tmp_filename, parser);
|
||||
if (G()->shared_config().get_option_boolean("disable_document_filenames")) {
|
||||
if (G()->get_option_boolean("disable_document_filenames")) {
|
||||
audio->file_name = "0";
|
||||
} else {
|
||||
audio->file_name = tmp_filename;
|
||||
@ -124,7 +123,7 @@ FileId AudiosManager::parse_audio(ParserT &parser) {
|
||||
if (has_minithumbnail) {
|
||||
string tmp_minithumbnail;
|
||||
parse(tmp_minithumbnail, parser);
|
||||
if (!G()->shared_config().get_option_boolean("disable_minithumbnails")) {
|
||||
if (!G()->get_option_boolean("disable_minithumbnails")) {
|
||||
audio->minithumbnail = tmp_minithumbnail;
|
||||
}
|
||||
}
|
||||
|
@ -8821,7 +8821,7 @@ class ContactsManager::UserLogEvent {
|
||||
|
||||
void ContactsManager::save_user(User *u, UserId user_id, bool from_binlog) {
|
||||
if (!G()->parameters().use_chat_info_db) {
|
||||
if (u != nullptr && G()->shared_config().get_option_boolean("receive_access_hashes", false)) {
|
||||
if (u != nullptr && G()->get_option_boolean("receive_access_hashes", false)) {
|
||||
send_closure(G()->td(), &Td::send_update,
|
||||
make_tl_object<td_api::updateAccessHash>(get_user_access_hash_object(user_id, u)));
|
||||
}
|
||||
@ -8829,7 +8829,7 @@ void ContactsManager::save_user(User *u, UserId user_id, bool from_binlog) {
|
||||
}
|
||||
CHECK(u != nullptr);
|
||||
if (!u->is_saved || !u->is_status_saved) { // TODO more effective handling of !u->is_status_saved
|
||||
if (u != nullptr && G()->shared_config().get_option_boolean("receive_access_hashes", false)) {
|
||||
if (u != nullptr && G()->get_option_boolean("receive_access_hashes", false)) {
|
||||
send_closure(G()->td(), &Td::send_update,
|
||||
make_tl_object<td_api::updateAccessHash>(get_user_access_hash_object(user_id, u)));
|
||||
}
|
||||
@ -9376,7 +9376,7 @@ class ContactsManager::ChannelLogEvent {
|
||||
|
||||
void ContactsManager::save_channel(Channel *c, ChannelId channel_id, bool from_binlog) {
|
||||
if (!G()->parameters().use_chat_info_db) {
|
||||
if (c != nullptr && G()->shared_config().get_option_boolean("receive_access_hashes", false)) {
|
||||
if (c != nullptr && G()->get_option_boolean("receive_access_hashes", false)) {
|
||||
send_closure(G()->td(), &Td::send_update,
|
||||
make_tl_object<td_api::updateAccessHash>(get_channel_access_hash_object(channel_id, c)));
|
||||
}
|
||||
@ -9384,7 +9384,7 @@ void ContactsManager::save_channel(Channel *c, ChannelId channel_id, bool from_b
|
||||
}
|
||||
CHECK(c != nullptr);
|
||||
if (!c->is_saved) {
|
||||
if (c != nullptr && G()->shared_config().get_option_boolean("receive_access_hashes", false)) {
|
||||
if (c != nullptr && G()->get_option_boolean("receive_access_hashes", false)) {
|
||||
send_closure(G()->td(), &Td::send_update,
|
||||
make_tl_object<td_api::updateAccessHash>(get_channel_access_hash_object(channel_id, c)));
|
||||
}
|
||||
|
@ -14,7 +14,6 @@
|
||||
#include "td/telegram/VideoNotesManager.h"
|
||||
#include "td/telegram/VideosManager.h"
|
||||
#include "td/telegram/Global.h"
|
||||
#include "td/telegram/ConfigShared.h"
|
||||
|
||||
#include "td/utils/algorithm.h"
|
||||
|
||||
@ -38,7 +37,7 @@ void Document::append_file_ids(const Td *td, vector<FileId> &file_ids) const {
|
||||
|
||||
file_ids.push_back(file_id);
|
||||
|
||||
if (!G()->shared_config().get_option_boolean("disable_minithumbnails")) {
|
||||
if (!G()->get_option_boolean("disable_minithumbnails")) {
|
||||
FileId thumbnail_file_id = [&] {
|
||||
switch (type) {
|
||||
case Type::Animation:
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
#include "td/utils/tl_helpers.h"
|
||||
|
||||
#include "td/telegram/ConfigShared.h"
|
||||
#include "td/telegram/ConfigManager.h"
|
||||
|
||||
namespace td {
|
||||
|
||||
@ -38,7 +38,7 @@ FileId DocumentsManager::parse_document(ParserT &parser) {
|
||||
|
||||
parse(document->mime_type, parser);
|
||||
|
||||
if ( G()->shared_config().get_option_boolean("disable_document_filenames") && (
|
||||
if ( G()->get_option_boolean("disable_document_filenames") && (
|
||||
document->mime_type.rfind("image/") == 0 ||
|
||||
document->mime_type.rfind("video/") == 0 ||
|
||||
document->mime_type.rfind("audio/") == 0)) {
|
||||
@ -50,7 +50,7 @@ FileId DocumentsManager::parse_document(ParserT &parser) {
|
||||
if (parser.version() >= static_cast<int32>(Version::SupportMinithumbnails)) {
|
||||
string tmp_minithumbnail;
|
||||
parse(tmp_minithumbnail, parser);
|
||||
if (!G()->shared_config().get_option_boolean("disable_minithumbnails")) {
|
||||
if (!G()->get_option_boolean("disable_minithumbnails")) {
|
||||
document->minithumbnail = tmp_minithumbnail;
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,6 @@
|
||||
#include "td/telegram/NotificationSettingsManager.h"
|
||||
#include "td/telegram/StickerSetId.h"
|
||||
#include "td/telegram/StickersManager.h"
|
||||
#include "td/telegram/ConfigShared.h"
|
||||
#include "td/telegram/Td.h"
|
||||
#include "td/telegram/WebPageId.h"
|
||||
#include "td/telegram/WebPagesManager.h"
|
||||
|
@ -9,7 +9,6 @@
|
||||
#include "td/telegram/AccessRights.h"
|
||||
#include "td/telegram/AuthManager.h"
|
||||
#include "td/telegram/ConfigManager.h"
|
||||
#include "td/telegram/ConfigShared.h"
|
||||
#include "td/telegram/ContactsManager.h"
|
||||
#include "td/telegram/DialogAction.h"
|
||||
#include "td/telegram/DialogParticipantFilter.h"
|
||||
@ -1174,7 +1173,7 @@ bool GroupCallManager::is_group_call_joined(InputGroupCallId input_group_call_id
|
||||
}
|
||||
|
||||
GroupCallId GroupCallManager::get_group_call_id(InputGroupCallId input_group_call_id, DialogId dialog_id) {
|
||||
if (G()->shared_config().get_option_boolean("disable_group_calls") || td_->auth_manager_->is_bot() || !input_group_call_id.is_valid()) {
|
||||
if (G()->get_option_boolean("disable_group_calls") || td_->auth_manager_->is_bot() || !input_group_call_id.is_valid()) {
|
||||
return GroupCallId();
|
||||
}
|
||||
return add_group_call(input_group_call_id, dialog_id)->group_call_id;
|
||||
@ -4152,7 +4151,7 @@ void GroupCallManager::on_update_group_call_connection(string &&connection_param
|
||||
}
|
||||
|
||||
void GroupCallManager::on_update_group_call(tl_object_ptr<telegram_api::GroupCall> group_call_ptr, DialogId dialog_id) {
|
||||
if (G()->shared_config().get_option_boolean("disable_group_calls") || td_->auth_manager_->is_bot()) {
|
||||
if (G()->get_option_boolean("disable_group_calls") || td_->auth_manager_->is_bot()) {
|
||||
return;
|
||||
}
|
||||
if (dialog_id != DialogId() && !dialog_id.is_valid()) {
|
||||
@ -4856,7 +4855,7 @@ tl_object_ptr<td_api::updateGroupCallParticipant> GroupCallManager::get_update_g
|
||||
|
||||
void GroupCallManager::send_update_group_call(const GroupCall *group_call, const char *source) {
|
||||
LOG(INFO) << "Send update about " << group_call->group_call_id << " from " << source;
|
||||
if (G()->shared_config().get_option_boolean("disable_group_calls")) {
|
||||
if (G()->get_option_boolean("disable_group_calls")) {
|
||||
return;
|
||||
}
|
||||
send_closure(G()->td(), &Td::send_update,
|
||||
@ -4865,7 +4864,7 @@ void GroupCallManager::send_update_group_call(const GroupCall *group_call, const
|
||||
|
||||
void GroupCallManager::send_update_group_call_participant(GroupCallId group_call_id,
|
||||
const GroupCallParticipant &participant, const char *source) {
|
||||
if (G()->shared_config().get_option_boolean("disable_group_calls")) {
|
||||
if (G()->get_option_boolean("disable_group_calls")) {
|
||||
return;
|
||||
}
|
||||
LOG(INFO) << "Send update about " << participant << " in " << group_call_id << " from " << source;
|
||||
@ -4874,7 +4873,7 @@ void GroupCallManager::send_update_group_call_participant(GroupCallId group_call
|
||||
|
||||
void GroupCallManager::send_update_group_call_participant(InputGroupCallId input_group_call_id,
|
||||
const GroupCallParticipant &participant, const char *source) {
|
||||
if (G()->shared_config().get_option_boolean("disable_group_calls")) {
|
||||
if (G()->get_option_boolean("disable_group_calls")) {
|
||||
return;
|
||||
}
|
||||
auto group_call = get_group_call(input_group_call_id);
|
||||
|
@ -13,7 +13,6 @@
|
||||
#include "td/telegram/AccessRights.h"
|
||||
#include "td/telegram/AuthManager.h"
|
||||
#include "td/telegram/ConfigManager.h"
|
||||
#include "td/telegram/ConfigShared.h"
|
||||
#include "td/telegram/ContactsManager.h"
|
||||
#include "td/telegram/DialogId.h"
|
||||
#include "td/telegram/Document.h"
|
||||
|
@ -3265,7 +3265,7 @@ void merge_message_contents(Td *td, const MessageContent *old_content, MessageCo
|
||||
if (old_photo->id.get() != new_photo->id.get() || old_->caption != new_->caption) {
|
||||
need_update = true;
|
||||
}
|
||||
if (!G()->shared_config().get_option_boolean("disable_minithumbnails")) {
|
||||
if (!G()->get_option_boolean("disable_minithumbnails")) {
|
||||
if (old_photo->minithumbnail != new_photo->minithumbnail) {
|
||||
need_update = true;
|
||||
}
|
||||
@ -5498,7 +5498,7 @@ void update_message_content_file_id_remote(MessageContent *content, FileId file_
|
||||
}
|
||||
|
||||
FileId get_message_content_thumbnail_file_id(const MessageContent *content, const Td *td) {
|
||||
if (!G()->shared_config().get_option_boolean("disable_minithumbnails")) {
|
||||
if (!G()->get_option_boolean("disable_minithumbnails")) {
|
||||
switch (content->get_type()) {
|
||||
case MessageContentType::Animation:
|
||||
return td->animations_manager_->get_animation_thumbnail_file_id(
|
||||
|
@ -10535,7 +10535,7 @@ void MessagesManager::on_get_message_public_forwards(int32 total_count,
|
||||
}
|
||||
|
||||
void MessagesManager::delete_messages_from_updates(const vector<MessageId> &message_ids) {
|
||||
if (G()->shared_config().get_option_boolean("ignore_server_deletes_and_reads", false)) {
|
||||
if (G()->get_option_boolean("ignore_server_deletes_and_reads", false)) {
|
||||
return;
|
||||
}
|
||||
FlatHashMap<DialogId, vector<int64>, DialogIdHash> deleted_message_ids;
|
||||
@ -12062,7 +12062,7 @@ void MessagesManager::read_all_dialog_reactions_on_server(DialogId dialog_id, ui
|
||||
}
|
||||
|
||||
void MessagesManager::read_message_content_from_updates(MessageId message_id) {
|
||||
if (G()->shared_config().get_option_boolean("ignore_server_deletes_and_reads", false)) {
|
||||
if (G()->get_option_boolean("ignore_server_deletes_and_reads", false)) {
|
||||
return;
|
||||
}
|
||||
if (!message_id.is_valid() || !message_id.is_server()) {
|
||||
@ -15934,7 +15934,7 @@ void MessagesManager::dump_debug_message_op(const Dialog *d, int priority) {
|
||||
}
|
||||
|
||||
bool MessagesManager::is_message_unload_enabled() const {
|
||||
auto has_custom_unload_time = G()->shared_config().have_option("message_unload_delay");
|
||||
auto has_custom_unload_time = G()->have_option("message_unload_delay");
|
||||
return G()->parameters().use_message_db || td_->auth_manager_->is_bot() || has_custom_unload_time;
|
||||
}
|
||||
|
||||
@ -16452,7 +16452,7 @@ void MessagesManager::on_message_deleted(Dialog *d, Message *m, bool is_permanen
|
||||
case DialogType::User:
|
||||
case DialogType::Chat:
|
||||
if (m->message_id.is_server()) {
|
||||
if (!G()->shared_config().get_option_boolean("ignore_server_deletes_and_reads", false)) {
|
||||
if (!G()->get_option_boolean("ignore_server_deletes_and_reads", false)) {
|
||||
message_id_to_dialog_id_.erase(m->message_id);
|
||||
}
|
||||
}
|
||||
@ -30765,7 +30765,7 @@ void MessagesManager::send_update_chat_last_message_impl(const Dialog *d, const
|
||||
return;
|
||||
}
|
||||
|
||||
if (G()->shared_config().get_option_boolean("ignore_update_chat_last_message")) {
|
||||
if (G()->get_option_boolean("ignore_update_chat_last_message")) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -30931,7 +30931,7 @@ void MessagesManager::send_update_chat_read_inbox(const Dialog *d, bool force, c
|
||||
LOG(INFO) << "Send updateChatReadInbox in " << d->dialog_id << "(" << get_dialog_title(d->dialog_id) << ") to "
|
||||
<< d->server_unread_count << " + " << d->local_unread_count << " from " << source;
|
||||
|
||||
if (!G()->shared_config().get_option_boolean("ignore_update_chat_read_inbox")) {
|
||||
if (!G()->get_option_boolean("ignore_update_chat_read_inbox")) {
|
||||
send_closure(G()->td(), &Td::send_update,
|
||||
make_tl_object<td_api::updateChatReadInbox>(d->dialog_id.get(), d->last_read_inbox_message_id.get(),
|
||||
d->server_unread_count + d->local_unread_count));
|
||||
|
@ -164,7 +164,7 @@ void NotificationManager::on_flush_pending_updates_timeout_callback(void *notifi
|
||||
}
|
||||
|
||||
bool NotificationManager::is_disabled() const {
|
||||
if ( G()->shared_config().get_option_boolean("disable_notifications")) {
|
||||
if ( G()->get_option_boolean("disable_notifications")) {
|
||||
return true;
|
||||
} else {
|
||||
return !td_->auth_manager_->is_authorized() || td_->auth_manager_->is_bot() || G()->close_flag();
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include "td/telegram/files/FileManager.h"
|
||||
#include "td/telegram/files/FileType.h"
|
||||
#include "td/telegram/net/DcId.h"
|
||||
#include "td/telegram/ConfigShared.h"
|
||||
#include "td/telegram/PhotoFormat.h"
|
||||
#include "td/telegram/PhotoSizeSource.h"
|
||||
|
||||
@ -40,7 +39,7 @@ ProfilePhoto get_profile_photo(FileManager *file_manager, UserId user_id, int64
|
||||
auto dc_id = DcId::create(profile_photo->dc_id_);
|
||||
result.has_animation = profile_photo->has_video_;
|
||||
result.id = profile_photo->photo_id_;
|
||||
if (!G()->shared_config().get_option_boolean("disable_minithumbnails")) {
|
||||
if (!G()->get_option_boolean("disable_minithumbnails")) {
|
||||
result.minithumbnail = profile_photo->stripped_thumb_.as_slice().str();
|
||||
}
|
||||
result.small_file_id = register_photo_size(
|
||||
@ -313,7 +312,7 @@ Photo get_photo(FileManager *file_manager, tl_object_ptr<telegram_api::photo> &&
|
||||
}
|
||||
res.photos.push_back(std::move(size));
|
||||
} else {
|
||||
if (G()->shared_config().get_option_boolean("disable_minithumbnails")) {
|
||||
if (G()->get_option_boolean("disable_minithumbnails")) {
|
||||
res.minithumbnail = "";
|
||||
} else {
|
||||
res.minithumbnail = std::move(photo_size.get<1>());
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include "td/telegram/Photo.h"
|
||||
#include "td/telegram/PhotoSize.hpp"
|
||||
#include "td/telegram/Version.h"
|
||||
#include "td/telegram/ConfigShared.h"
|
||||
|
||||
#include "td/utils/tl_helpers.h"
|
||||
|
||||
@ -23,13 +22,13 @@ void store(const DialogPhoto &dialog_photo, StorerT &storer) {
|
||||
BEGIN_STORE_FLAGS();
|
||||
STORE_FLAG(has_file_ids);
|
||||
STORE_FLAG(dialog_photo.has_animation);
|
||||
STORE_FLAG(!G()->shared_config().get_option_boolean("disable_minithumbnails") && has_minithumbnail);
|
||||
STORE_FLAG(!G()->get_option_boolean("disable_minithumbnails") && has_minithumbnail);
|
||||
END_STORE_FLAGS();
|
||||
if (has_file_ids) {
|
||||
store(dialog_photo.small_file_id, storer);
|
||||
store(dialog_photo.big_file_id, storer);
|
||||
}
|
||||
if (!G()->shared_config().get_option_boolean("disable_minithumbnails") && has_minithumbnail) {
|
||||
if (!G()->get_option_boolean("disable_minithumbnails") && has_minithumbnail) {
|
||||
store(dialog_photo.minithumbnail, storer);
|
||||
}
|
||||
}
|
||||
@ -52,7 +51,7 @@ void parse(DialogPhoto &dialog_photo, ParserT &parser) {
|
||||
if (has_minithumbnail) {
|
||||
std::basic_string<char> minithumbnail;
|
||||
parse(minithumbnail, parser);
|
||||
if (!G()->shared_config().get_option_boolean("disable_minithumbnails")) {
|
||||
if (!G()->get_option_boolean("disable_minithumbnails")) {
|
||||
dialog_photo.minithumbnail = minithumbnail;
|
||||
}
|
||||
}
|
||||
@ -76,7 +75,7 @@ void store(const Photo &photo, StorerT &storer) {
|
||||
bool has_animations = !photo.animations.empty();
|
||||
BEGIN_STORE_FLAGS();
|
||||
STORE_FLAG(photo.has_stickers);
|
||||
STORE_FLAG(!G()->shared_config().get_option_boolean("disable_minithumbnails") && has_minithumbnail);
|
||||
STORE_FLAG(!G()->get_option_boolean("disable_minithumbnails") && has_minithumbnail);
|
||||
STORE_FLAG(has_animations);
|
||||
END_STORE_FLAGS();
|
||||
store(photo.id.get(), storer);
|
||||
@ -85,7 +84,7 @@ void store(const Photo &photo, StorerT &storer) {
|
||||
if (photo.has_stickers) {
|
||||
store(photo.sticker_file_ids, storer);
|
||||
}
|
||||
if (!G()->shared_config().get_option_boolean("disable_minithumbnails") && has_minithumbnail) {
|
||||
if (!G()->get_option_boolean("disable_minithumbnails") && has_minithumbnail) {
|
||||
store(photo.minithumbnail, storer);
|
||||
}
|
||||
if (has_animations) {
|
||||
@ -113,7 +112,7 @@ void parse(Photo &photo, ParserT &parser) {
|
||||
if (has_minithumbnail) {
|
||||
std::basic_string<char> minithumbnail;
|
||||
parse(minithumbnail, parser);
|
||||
if (!G()->shared_config().get_option_boolean("disable_minithumbnails")) {
|
||||
if (!G()->get_option_boolean("disable_minithumbnails")) {
|
||||
photo.minithumbnail = minithumbnail;
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,6 @@
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
#include "td/telegram/PhotoSize.h"
|
||||
#include "td/telegram/ConfigShared.h"
|
||||
|
||||
#include "td/telegram/files/FileLocation.h"
|
||||
#include "td/telegram/files/FileManager.h"
|
||||
@ -45,7 +44,7 @@ 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")) {
|
||||
if (G()->get_option_boolean("disable_minithumbnails")) {
|
||||
return nullptr;
|
||||
}
|
||||
if (packed.size() < 3) {
|
||||
@ -197,19 +196,19 @@ 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) {
|
||||
if (G()->shared_config().get_option_boolean("disable_minithumbnails")) {
|
||||
if (G()->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")) {
|
||||
if (G()->get_option_boolean("disable_minithumbnails")) {
|
||||
return std::string("");
|
||||
} else {
|
||||
return std::move(res);
|
||||
}
|
||||
}
|
||||
if (G()->shared_config().get_option_boolean("disable_minithumbnails")) {
|
||||
if (G()->get_option_boolean("disable_minithumbnails")) {
|
||||
return std::string("");
|
||||
} else {
|
||||
return size->bytes_.as_slice().str();
|
||||
|
@ -17,7 +17,6 @@
|
||||
|
||||
#include "td/actor/actor.h"
|
||||
|
||||
#include "td/telegram/ConfigShared.h"
|
||||
#include "td/utils/logging.h"
|
||||
#include "td/utils/Status.h"
|
||||
|
||||
@ -62,7 +61,7 @@ FileId VideoNotesManager::on_get_video_note(unique_ptr<VideoNote> new_video_note
|
||||
v->duration = new_video_note->duration;
|
||||
v->dimensions = new_video_note->dimensions;
|
||||
}
|
||||
if (!G()->shared_config().get_option_boolean("disable_minithumbnails")) {
|
||||
if (!G()->get_option_boolean("disable_minithumbnails")) {
|
||||
if (v->minithumbnail != new_video_note->minithumbnail) {
|
||||
v->minithumbnail = std::move(new_video_note->minithumbnail);
|
||||
}
|
||||
@ -136,7 +135,7 @@ void VideoNotesManager::create_video_note(FileId file_id, string minithumbnail,
|
||||
} else {
|
||||
LOG(INFO) << "Receive wrong video note dimensions " << dimensions;
|
||||
}
|
||||
if (!td_->auth_manager_->is_bot() && !G()->shared_config().get_option_boolean("disable_minithumbnails")) {
|
||||
if (!td_->auth_manager_->is_bot() && !G()->get_option_boolean("disable_minithumbnails")) {
|
||||
v->minithumbnail = std::move(minithumbnail);
|
||||
}
|
||||
v->thumbnail = std::move(thumbnail);
|
||||
|
@ -36,7 +36,7 @@ FileId VideoNotesManager::parse_video_note(ParserT &parser) {
|
||||
if (parser.version() >= static_cast<int32>(Version::SupportMinithumbnails)) {
|
||||
string tmp_minithumbnail;
|
||||
parse(tmp_minithumbnail, parser);
|
||||
if (!G()->shared_config().get_option_boolean("disable_minithumbnails")) {
|
||||
if (!G()->get_option_boolean("disable_minithumbnails")) {
|
||||
video_note->minithumbnail = tmp_minithumbnail;
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,6 @@
|
||||
#include "td/telegram/Td.h"
|
||||
#include "td/telegram/td_api.h"
|
||||
#include "td/telegram/telegram_api.h"
|
||||
#include "td/telegram/ConfigShared.h"
|
||||
|
||||
#include "td/actor/actor.h"
|
||||
|
||||
@ -77,7 +76,7 @@ FileId VideosManager::on_get_video(unique_ptr<Video> new_video, bool replace) {
|
||||
LOG(DEBUG) << "Video " << file_id << " file name has changed";
|
||||
v->file_name = std::move(new_video->file_name);
|
||||
}
|
||||
if (!G()->shared_config().get_option_boolean("disable_minithumbnails")) {
|
||||
if (!G()->get_option_boolean("disable_minithumbnails")) {
|
||||
if (v->minithumbnail != new_video->minithumbnail) {
|
||||
v->minithumbnail = std::move(new_video->minithumbnail);
|
||||
}
|
||||
@ -178,7 +177,7 @@ 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 (!td_->auth_manager_->is_bot() && G()->shared_config().get_option_boolean("disable_minithumbnails")) {
|
||||
if (!td_->auth_manager_->is_bot() && G()->get_option_boolean("disable_minithumbnails")) {
|
||||
v->minithumbnail = std::move(minithumbnail);
|
||||
}
|
||||
v->thumbnail = std::move(thumbnail);
|
||||
|
@ -57,7 +57,7 @@ FileId VideosManager::parse_video(ParserT &parser) {
|
||||
|
||||
parse(video->mime_type, parser);
|
||||
|
||||
if ( G()->shared_config().get_option_boolean("disable_document_filenames") && (
|
||||
if ( G()->get_option_boolean("disable_document_filenames") && (
|
||||
video->mime_type.rfind("image/") == 0 ||
|
||||
video->mime_type.rfind("video/") == 0 ||
|
||||
video->mime_type.rfind("audio/") == 0)) {
|
||||
@ -71,7 +71,7 @@ FileId VideosManager::parse_video(ParserT &parser) {
|
||||
if (parser.version() >= static_cast<int32>(Version::SupportMinithumbnails)) {
|
||||
string tmp_minithumbnail;
|
||||
parse(tmp_minithumbnail, parser);
|
||||
if (!G()->shared_config().get_option_boolean("disable_minithumbnails")) {
|
||||
if (!G()->get_option_boolean("disable_minithumbnails")) {
|
||||
video->minithumbnail = tmp_minithumbnail;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user