Update tdlight

This commit is contained in:
Andrea Cavalli 2024-02-21 18:20:27 +01:00
parent 616bd6a203
commit eb6a8d55c8
5 changed files with 38 additions and 21 deletions

View File

@ -8,8 +8,8 @@
<name>TDLight Java BOM</name> <name>TDLight Java BOM</name>
<properties> <properties>
<revision>3.0.0.0-SNAPSHOT</revision> <revision>3.0.0.0-SNAPSHOT</revision>
<tdlight.natives.version>4.0.495</tdlight.natives.version> <tdlight.natives.version>4.0.502</tdlight.natives.version>
<tdlight.api.version>4.0.465</tdlight.api.version> <tdlight.api.version>4.0.472</tdlight.api.version>
<maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target> <maven.compiler.target>1.8</maven.compiler.target>
</properties> </properties>

View File

@ -71,12 +71,12 @@
<dependency> <dependency>
<groupId>org.apache.logging.log4j</groupId> <groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId> <artifactId>log4j-core</artifactId>
<version>2.20.0</version> <version>2.22.1</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.logging.log4j</groupId> <groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j2-impl</artifactId> <artifactId>log4j-slf4j2-impl</artifactId>
<version>2.20.0</version> <version>2.22.1</version>
<exclusions> <exclusions>
<exclusion> <exclusion>
<groupId>junit</groupId> <groupId>junit</groupId>

View File

@ -48,7 +48,7 @@ final class AuthorizationStateWaitRegistrationHandler implements GenericUpdateHa
exceptionHandler.onException(new IllegalArgumentException("Last name must be under 64 characters")); exceptionHandler.onException(new IllegalArgumentException("Last name must be under 64 characters"));
return; return;
} }
RegisterUser response = new RegisterUser(firstName, lastName); RegisterUser response = new RegisterUser(firstName, lastName, true);
client.send(response, ok -> { client.send(response, ok -> {
if (ok.getConstructor() == TdApi.Error.CONSTRUCTOR) { if (ok.getConstructor() == TdApi.Error.CONSTRUCTOR) {
throw new TelegramError((TdApi.Error) ok); throw new TelegramError((TdApi.Error) ok);

View File

@ -37,8 +37,6 @@ final class AuthorizationStateWaitTdlibParametersHandler implements GenericUpdat
params.deviceModel = settings.getDeviceModel(); params.deviceModel = settings.getDeviceModel();
params.systemVersion = settings.getSystemVersion(); params.systemVersion = settings.getSystemVersion();
params.applicationVersion = settings.getApplicationVersion(); params.applicationVersion = settings.getApplicationVersion();
params.enableStorageOptimizer = settings.isStorageOptimizerEnabled();
params.ignoreFileNames = settings.isIgnoreFileNames();
params.databaseEncryptionKey = null; params.databaseEncryptionKey = null;
client.send(params, ok -> { client.send(params, ok -> {
if (ok.getConstructor() == TdApi.Error.CONSTRUCTOR) { if (ok.getConstructor() == TdApi.Error.CONSTRUCTOR) {

View File

@ -29,9 +29,8 @@ public final class TDLibSettings {
private String deviceModel; private String deviceModel;
private String systemVersion; private String systemVersion;
private String applicationVersion; private String applicationVersion;
private boolean enableStorageOptimizer;
private boolean ignoreFileNames;
@Deprecated
private TDLibSettings(boolean useTestDatacenter, private TDLibSettings(boolean useTestDatacenter,
Path databaseDirectoryPath, Path databaseDirectoryPath,
Path downloadedFilesDirectoryPath, Path downloadedFilesDirectoryPath,
@ -45,6 +44,31 @@ public final class TDLibSettings {
String applicationVersion, String applicationVersion,
boolean enableStorageOptimizer, boolean enableStorageOptimizer,
boolean ignoreFileNames) { boolean ignoreFileNames) {
this(useTestDatacenter,
databaseDirectoryPath,
downloadedFilesDirectoryPath,
fileDatabaseEnabled,
chatInfoDatabaseEnabled,
messageDatabaseEnabled,
apiToken,
systemLanguageCode,
deviceModel,
systemVersion,
applicationVersion
);
}
private TDLibSettings(boolean useTestDatacenter,
Path databaseDirectoryPath,
Path downloadedFilesDirectoryPath,
boolean fileDatabaseEnabled,
boolean chatInfoDatabaseEnabled,
boolean messageDatabaseEnabled,
APIToken apiToken,
String systemLanguageCode,
String deviceModel,
String systemVersion,
String applicationVersion) {
this.useTestDatacenter = useTestDatacenter; this.useTestDatacenter = useTestDatacenter;
this.databaseDirectoryPath = databaseDirectoryPath; this.databaseDirectoryPath = databaseDirectoryPath;
this.downloadedFilesDirectoryPath = downloadedFilesDirectoryPath; this.downloadedFilesDirectoryPath = downloadedFilesDirectoryPath;
@ -56,8 +80,6 @@ public final class TDLibSettings {
this.deviceModel = deviceModel; this.deviceModel = deviceModel;
this.systemVersion = systemVersion; this.systemVersion = systemVersion;
this.applicationVersion = applicationVersion; this.applicationVersion = applicationVersion;
this.enableStorageOptimizer = enableStorageOptimizer;
this.ignoreFileNames = ignoreFileNames;
} }
public static TDLibSettings create(APIToken apiToken) { public static TDLibSettings create(APIToken apiToken) {
@ -165,20 +187,22 @@ public final class TDLibSettings {
this.applicationVersion = applicationVersion; this.applicationVersion = applicationVersion;
} }
@Deprecated
public boolean isStorageOptimizerEnabled() { public boolean isStorageOptimizerEnabled() {
return enableStorageOptimizer; return false;
} }
@Deprecated
public void setEnableStorageOptimizer(boolean enableStorageOptimizer) { public void setEnableStorageOptimizer(boolean enableStorageOptimizer) {
this.enableStorageOptimizer = enableStorageOptimizer;
} }
@Deprecated
public boolean isIgnoreFileNames() { public boolean isIgnoreFileNames() {
return ignoreFileNames; return false;
} }
@Deprecated
public void setIgnoreFileNames(boolean ignoreFileNames) { public void setIgnoreFileNames(boolean ignoreFileNames) {
this.ignoreFileNames = ignoreFileNames;
} }
@Override @Override
@ -193,7 +217,6 @@ public final class TDLibSettings {
return useTestDatacenter == that.useTestDatacenter && fileDatabaseEnabled == that.fileDatabaseEnabled return useTestDatacenter == that.useTestDatacenter && fileDatabaseEnabled == that.fileDatabaseEnabled
&& chatInfoDatabaseEnabled == that.chatInfoDatabaseEnabled && chatInfoDatabaseEnabled == that.chatInfoDatabaseEnabled
&& messageDatabaseEnabled == that.messageDatabaseEnabled && messageDatabaseEnabled == that.messageDatabaseEnabled
&& enableStorageOptimizer == that.enableStorageOptimizer && ignoreFileNames == that.ignoreFileNames
&& Objects.equals(databaseDirectoryPath, that.databaseDirectoryPath) && Objects.equals( && Objects.equals(databaseDirectoryPath, that.databaseDirectoryPath) && Objects.equals(
downloadedFilesDirectoryPath, downloadedFilesDirectoryPath,
that.downloadedFilesDirectoryPath that.downloadedFilesDirectoryPath
@ -214,9 +237,7 @@ public final class TDLibSettings {
systemLanguageCode, systemLanguageCode,
deviceModel, deviceModel,
systemVersion, systemVersion,
applicationVersion, applicationVersion
enableStorageOptimizer,
ignoreFileNames
); );
} }
@ -234,8 +255,6 @@ public final class TDLibSettings {
.add("deviceModel='" + deviceModel + "'") .add("deviceModel='" + deviceModel + "'")
.add("systemVersion='" + systemVersion + "'") .add("systemVersion='" + systemVersion + "'")
.add("applicationVersion='" + applicationVersion + "'") .add("applicationVersion='" + applicationVersion + "'")
.add("enableStorageOptimizer=" + enableStorageOptimizer)
.add("ignoreFileNames=" + ignoreFileNames)
.toString(); .toString();
} }
} }