Improve TdParameters.

This commit is contained in:
levlam 2023-03-13 16:06:43 +03:00
parent 0f45b3bd6e
commit 7bd211fd82
2 changed files with 15 additions and 14 deletions

View File

@ -4104,17 +4104,17 @@ Status Td::set_parameters(td_api::object_ptr<td_api::setTdlibParameters> paramet
return Status::Error(400, "Strings must be encoded in UTF-8");
}
parameters_.use_test_dc = parameters->use_test_dc_;
parameters_.database_directory = parameters->database_directory_;
parameters_.files_directory = parameters->files_directory_;
parameters_.api_id = parameters->api_id_;
parameters_.api_hash = parameters->api_hash_;
parameters_.use_test_dc = parameters->use_test_dc_;
parameters_.use_file_db = parameters->use_file_database_;
parameters_.enable_storage_optimizer = parameters->enable_storage_optimizer_;
parameters_.ignore_file_names = parameters->ignore_file_names_;
parameters_.use_secret_chats = parameters->use_secret_chats_;
parameters_.use_chat_info_db = parameters->use_chat_info_database_;
parameters_.use_message_db = parameters->use_message_database_;
parameters_.use_secret_chats = parameters->use_secret_chats_;
parameters_.enable_storage_optimizer = parameters->enable_storage_optimizer_;
parameters_.ignore_file_names = parameters->ignore_file_names_;
TRY_STATUS(fix_parameters(parameters_));

View File

@ -6,23 +6,24 @@
//
#pragma once
#include <cstdint>
#include <string>
#include "td/utils/common.h"
namespace td {
struct TdParameters {
string database_directory;
string files_directory;
int32 api_id = 0;
string api_hash;
bool use_test_dc = false;
std::string database_directory;
std::string files_directory;
std::int32_t api_id = 0;
std::string api_hash;
bool use_file_db = true;
bool enable_storage_optimizer = false;
bool ignore_file_names = false;
bool use_secret_chats = false;
bool use_file_db = false;
bool use_chat_info_db = false;
bool use_message_db = false;
bool use_secret_chats = false;
// TODO move to options
bool enable_storage_optimizer = false;
bool ignore_file_names = false;
};
} // namespace td