Set database directory in examples.

GitOrigin-RevId: bbbd31f3a7f044cf12db36bbce21363ee6019cde
This commit is contained in:
levlam 2018-02-26 12:41:12 +03:00
parent 751029d45d
commit 4ebb813907
3 changed files with 4 additions and 1 deletions

View File

@ -273,6 +273,7 @@ class TdExample {
}, },
[this](td_api::authorizationStateWaitTdlibParameters &) { [this](td_api::authorizationStateWaitTdlibParameters &) {
auto parameters = td_api::make_object<td_api::tdlibParameters>(); auto parameters = td_api::make_object<td_api::tdlibParameters>();
parameters->database_directory_ = "tdlib";
parameters->use_message_database_ = true; parameters->use_message_database_ = true;
parameters->use_secret_chats_ = true; parameters->use_secret_chats_ = true;
parameters->api_id_ = 94575; parameters->api_id_ = 94575;

View File

@ -83,6 +83,7 @@ public final class Example {
switch (Example.authorizationState.getConstructor()) { switch (Example.authorizationState.getConstructor()) {
case TdApi.AuthorizationStateWaitTdlibParameters.CONSTRUCTOR: case TdApi.AuthorizationStateWaitTdlibParameters.CONSTRUCTOR:
TdApi.TdlibParameters parameters = new TdApi.TdlibParameters(); TdApi.TdlibParameters parameters = new TdApi.TdlibParameters();
parameters.databaseDirectory = "tdlib";
parameters.useMessageDatabase = true; parameters.useMessageDatabase = true;
parameters.useSecretChats = true; parameters.useSecretChats = true;
parameters.apiId = 94575; parameters.apiId = 94575;
@ -265,7 +266,7 @@ public final class Example {
public static void main(String[] args) throws InterruptedException { public static void main(String[] args) throws InterruptedException {
// disable TDLib log // disable TDLib log
Log.setVerbosityLevel(0); Log.setVerbosityLevel(0);
if (!Log.setFilePath("log")) { if (!Log.setFilePath("tdlib.log")) {
throw new IOError(new IOException("Write access to the current directory is required")); throw new IOError(new IOException("Write access to the current directory is required"));
} }

View File

@ -103,6 +103,7 @@ func updateAuthorizationState(authState: Dictionary<String, Any>) {
client.queryAsync(query:[ client.queryAsync(query:[
"@type":"setTdlibParameters", "@type":"setTdlibParameters",
"parameters":[ "parameters":[
"database_directory":"tdlib",
"use_message_database":true, "use_message_database":true,
"use_secret_chats":true, "use_secret_chats":true,
"api_id":94575, "api_id":94575,