Remove setTdlibParameters.enable_storage_optimizer/ignore_file_names parameters in favor of "use_storage_optimizer" and "ignore_file_names" options.

This commit is contained in:
levlam 2024-01-11 13:54:23 +03:00
parent bf6345248f
commit 562374088c
10 changed files with 3 additions and 21 deletions

View File

@ -314,7 +314,6 @@ class TdExample {
request->system_language_code_ = "en";
request->device_model_ = "Desktop";
request->application_version_ = "1.0";
request->enable_storage_optimizer_ = true;
send_query(std::move(request), create_authentication_query_handler());
}));
}

View File

@ -76,7 +76,6 @@ namespace TdExample
request.SystemLanguageCode = "en";
request.DeviceModel = "Desktop";
request.ApplicationVersion = "1.0";
request.EnableStorageOptimizer = true;
_client.Send(request, new AuthorizationRequestHandler());
}

View File

@ -102,7 +102,6 @@ public final class Example {
request.systemLanguageCode = "en";
request.deviceModel = "Desktop";
request.applicationVersion = "1.0";
request.enableStorageOptimizer = true;
client.send(request, new AuthorizationRequestHandler());
break;

View File

@ -106,8 +106,7 @@ while True:
'api_hash': 'a3406de8d171bb422bb6ddf3bbd800e2',
'system_language_code': 'en',
'device_model': 'Desktop',
'application_version': '1.0',
'enable_storage_optimizer': True})
'application_version': '1.0'})
# enter phone number to log in
if auth_state['@type'] == 'authorizationStateWaitPhoneNumber':

View File

@ -114,8 +114,7 @@ func updateAuthorizationState(authorizationState: Dictionary<String, Any>) {
"api_hash":"a3406de8d171bb422bb6ddf3bbd800e2",
"system_language_code":"en",
"device_model":"Desktop",
"application_version":"1.0",
"enable_storage_optimizer":true
"application_version":"1.0"
]);
case "authorizationStateWaitPhoneNumber":

View File

@ -6829,9 +6829,7 @@ getAuthorizationState = AuthorizationState;
//@device_model Model of the device the application is being run on; must be non-empty
//@system_version Version of the operating system the application is being run on. If empty, the version is automatically detected by TDLib
//@application_version Application version; must be non-empty
//@enable_storage_optimizer Pass true to automatically delete old files in background
//@ignore_file_names Pass true to ignore original file names for downloaded files. Otherwise, downloaded files are saved under names as close as possible to the original name
setTdlibParameters use_test_dc:Bool database_directory:string files_directory:string database_encryption_key:bytes use_file_database:Bool use_chat_info_database:Bool use_message_database:Bool use_secret_chats:Bool api_id:int32 api_hash:string system_language_code:string device_model:string system_version:string application_version:string enable_storage_optimizer:Bool ignore_file_names:Bool = Ok;
setTdlibParameters use_test_dc:Bool database_directory:string files_directory:string database_encryption_key:bytes use_file_database:Bool use_chat_info_database:Bool use_message_database:Bool use_secret_chats:Bool api_id:int32 api_hash:string system_language_code:string device_model:string system_version:string application_version:string = Ok;
//@description Sets the phone number of the user and sends an authentication code to the user. Works only when the current authorization state is authorizationStateWaitPhoneNumber,
//-or if there is no pending authentication query and the current authorization state is authorizationStateWaitEmailAddress, authorizationStateWaitEmailCode, authorizationStateWaitCode, authorizationStateWaitRegistration, or authorizationStateWaitPassword

View File

@ -3500,9 +3500,6 @@ void Td::init(Parameters parameters, Result<TdDb::OpenedDatabase> r_opened_datab
init_options_and_network();
option_manager_->set_option_boolean("use_storage_optimizer", parameters.enable_storage_optimizer_);
option_manager_->set_option_boolean("ignore_file_names", parameters.ignore_file_names_);
// we need to process td_api::getOption along with td_api::setOption for consistency
// we need to process td_api::setOption before managers and MTProto header are created,
// because their initialiation may be affected by the options
@ -4087,8 +4084,6 @@ Result<std::pair<Td::Parameters, TdDb::Parameters>> Td::get_parameters(
result.first.api_id_ = parameters->api_id_;
result.first.api_hash_ = std::move(parameters->api_hash_);
result.first.use_secret_chats_ = parameters->use_secret_chats_;
result.first.enable_storage_optimizer_ = parameters->enable_storage_optimizer_;
result.first.ignore_file_names_ = parameters->ignore_file_names_;
result.second.encryption_key_ = as_db_key(std::move(parameters->database_encryption_key_));
result.second.database_directory_ = std::move(parameters->database_directory_);

View File

@ -1824,10 +1824,6 @@ class Td final : public Actor {
int32 api_id_ = 0;
string api_hash_;
bool use_secret_chats_ = false;
// TODO move to options and remove
bool enable_storage_optimizer_ = false;
bool ignore_file_names_ = false;
};
void finish_set_parameters();

View File

@ -244,7 +244,6 @@ class InitTask : public Task {
request->system_language_code_ = "en";
request->device_model_ = "Desktop";
request->application_version_ = "tdclient-test";
request->enable_storage_optimizer_ = true;
send(std::move(request));
break;
}

View File

@ -237,7 +237,6 @@ class DoAuthentication final : public TestClinetTask {
request->system_language_code_ = "en";
request->device_model_ = "Desktop";
request->application_version_ = "tdclient-test";
request->enable_storage_optimizer_ = true;
function = std::move(request);
break;
}