Skip to content

Commit eb6a8d5

Browse files
committed
Update tdlight
1 parent 616bd6a commit eb6a8d5

File tree

5 files changed

+38
-21
lines changed

5 files changed

+38
-21
lines changed

bom/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
<name>TDLight Java BOM</name>
99
<properties>
1010
<revision>3.0.0.0-SNAPSHOT</revision>
11-
<tdlight.natives.version>4.0.495</tdlight.natives.version>
12-
<tdlight.api.version>4.0.465</tdlight.api.version>
11+
<tdlight.natives.version>4.0.502</tdlight.natives.version>
12+
<tdlight.api.version>4.0.472</tdlight.api.version>
1313
<maven.compiler.source>1.8</maven.compiler.source>
1414
<maven.compiler.target>1.8</maven.compiler.target>
1515
</properties>

example/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@
7171
<dependency>
7272
<groupId>org.apache.logging.log4j</groupId>
7373
<artifactId>log4j-core</artifactId>
74-
<version>2.20.0</version>
74+
<version>2.22.1</version>
7575
</dependency>
7676
<dependency>
7777
<groupId>org.apache.logging.log4j</groupId>
7878
<artifactId>log4j-slf4j2-impl</artifactId>
79-
<version>2.20.0</version>
79+
<version>2.22.1</version>
8080
<exclusions>
8181
<exclusion>
8282
<groupId>junit</groupId>

tdlight-java/src/main/java/it/tdlight/client/AuthorizationStateWaitRegistrationHandler.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public void onUpdate(UpdateAuthorizationState update) {
4848
exceptionHandler.onException(new IllegalArgumentException("Last name must be under 64 characters"));
4949
return;
5050
}
51-
RegisterUser response = new RegisterUser(firstName, lastName);
51+
RegisterUser response = new RegisterUser(firstName, lastName, true);
5252
client.send(response, ok -> {
5353
if (ok.getConstructor() == TdApi.Error.CONSTRUCTOR) {
5454
throw new TelegramError((TdApi.Error) ok);

tdlight-java/src/main/java/it/tdlight/client/AuthorizationStateWaitTdlibParametersHandler.java

-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ public void onUpdate(UpdateAuthorizationState update) {
3737
params.deviceModel = settings.getDeviceModel();
3838
params.systemVersion = settings.getSystemVersion();
3939
params.applicationVersion = settings.getApplicationVersion();
40-
params.enableStorageOptimizer = settings.isStorageOptimizerEnabled();
41-
params.ignoreFileNames = settings.isIgnoreFileNames();
4240
params.databaseEncryptionKey = null;
4341
client.send(params, ok -> {
4442
if (ok.getConstructor() == TdApi.Error.CONSTRUCTOR) {

tdlight-java/src/main/java/it/tdlight/client/TDLibSettings.java

+33-14
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ public final class TDLibSettings {
2929
private String deviceModel;
3030
private String systemVersion;
3131
private String applicationVersion;
32-
private boolean enableStorageOptimizer;
33-
private boolean ignoreFileNames;
3432

33+
@Deprecated
3534
private TDLibSettings(boolean useTestDatacenter,
3635
Path databaseDirectoryPath,
3736
Path downloadedFilesDirectoryPath,
@@ -45,6 +44,31 @@ private TDLibSettings(boolean useTestDatacenter,
4544
String applicationVersion,
4645
boolean enableStorageOptimizer,
4746
boolean ignoreFileNames) {
47+
this(useTestDatacenter,
48+
databaseDirectoryPath,
49+
downloadedFilesDirectoryPath,
50+
fileDatabaseEnabled,
51+
chatInfoDatabaseEnabled,
52+
messageDatabaseEnabled,
53+
apiToken,
54+
systemLanguageCode,
55+
deviceModel,
56+
systemVersion,
57+
applicationVersion
58+
);
59+
}
60+
61+
private TDLibSettings(boolean useTestDatacenter,
62+
Path databaseDirectoryPath,
63+
Path downloadedFilesDirectoryPath,
64+
boolean fileDatabaseEnabled,
65+
boolean chatInfoDatabaseEnabled,
66+
boolean messageDatabaseEnabled,
67+
APIToken apiToken,
68+
String systemLanguageCode,
69+
String deviceModel,
70+
String systemVersion,
71+
String applicationVersion) {
4872
this.useTestDatacenter = useTestDatacenter;
4973
this.databaseDirectoryPath = databaseDirectoryPath;
5074
this.downloadedFilesDirectoryPath = downloadedFilesDirectoryPath;
@@ -56,8 +80,6 @@ private TDLibSettings(boolean useTestDatacenter,
5680
this.deviceModel = deviceModel;
5781
this.systemVersion = systemVersion;
5882
this.applicationVersion = applicationVersion;
59-
this.enableStorageOptimizer = enableStorageOptimizer;
60-
this.ignoreFileNames = ignoreFileNames;
6183
}
6284

6385
public static TDLibSettings create(APIToken apiToken) {
@@ -165,20 +187,22 @@ public void setApplicationVersion(String applicationVersion) {
165187
this.applicationVersion = applicationVersion;
166188
}
167189

190+
@Deprecated
168191
public boolean isStorageOptimizerEnabled() {
169-
return enableStorageOptimizer;
192+
return false;
170193
}
171194

195+
@Deprecated
172196
public void setEnableStorageOptimizer(boolean enableStorageOptimizer) {
173-
this.enableStorageOptimizer = enableStorageOptimizer;
174197
}
175198

199+
@Deprecated
176200
public boolean isIgnoreFileNames() {
177-
return ignoreFileNames;
201+
return false;
178202
}
179203

204+
@Deprecated
180205
public void setIgnoreFileNames(boolean ignoreFileNames) {
181-
this.ignoreFileNames = ignoreFileNames;
182206
}
183207

184208
@Override
@@ -193,7 +217,6 @@ public boolean equals(Object o) {
193217
return useTestDatacenter == that.useTestDatacenter && fileDatabaseEnabled == that.fileDatabaseEnabled
194218
&& chatInfoDatabaseEnabled == that.chatInfoDatabaseEnabled
195219
&& messageDatabaseEnabled == that.messageDatabaseEnabled
196-
&& enableStorageOptimizer == that.enableStorageOptimizer && ignoreFileNames == that.ignoreFileNames
197220
&& Objects.equals(databaseDirectoryPath, that.databaseDirectoryPath) && Objects.equals(
198221
downloadedFilesDirectoryPath,
199222
that.downloadedFilesDirectoryPath
@@ -214,9 +237,7 @@ public int hashCode() {
214237
systemLanguageCode,
215238
deviceModel,
216239
systemVersion,
217-
applicationVersion,
218-
enableStorageOptimizer,
219-
ignoreFileNames
240+
applicationVersion
220241
);
221242
}
222243

@@ -234,8 +255,6 @@ public String toString() {
234255
.add("deviceModel='" + deviceModel + "'")
235256
.add("systemVersion='" + systemVersion + "'")
236257
.add("applicationVersion='" + applicationVersion + "'")
237-
.add("enableStorageOptimizer=" + enableStorageOptimizer)
238-
.add("ignoreFileNames=" + ignoreFileNames)
239258
.toString();
240259
}
241260
}

0 commit comments

Comments
 (0)