Update libsignal-service-java

This commit is contained in:
AsamK 2024-04-06 13:56:25 +02:00
parent d4e1f9b7f1
commit 419beee29a
5 changed files with 20 additions and 20 deletions

View file

@ -233,7 +233,7 @@ public class RecipientHelper {
token,
dependencies.getServiceEnvironmentConfig().cdsiMrenclave(),
null,
dependencies.getServiceEnvironmentConfig().netEnvironment(),
dependencies.getLibSignalNetwork(),
newToken -> {
if (isPartialRefresh) {
account.getCdsiStore().updateAfterPartialCdsQuery(newNumbers);

View file

@ -3,6 +3,7 @@ package org.asamk.signal.manager.internal;
import org.asamk.signal.manager.config.ServiceConfig;
import org.asamk.signal.manager.config.ServiceEnvironmentConfig;
import org.signal.libsignal.metadata.certificate.CertificateValidator;
import org.signal.libsignal.net.Network;
import org.signal.libsignal.zkgroup.profiles.ClientZkProfileOperations;
import org.whispersystems.signalservice.api.SignalServiceAccountManager;
import org.whispersystems.signalservice.api.SignalServiceDataStore;
@ -48,6 +49,7 @@ public class SignalDependencies {
private ClientZkOperations clientZkOperations;
private PushServiceSocket pushServiceSocket;
private Network libSignalNetwork;
private SignalWebSocket signalWebSocket;
private SignalServiceMessageReceiver messageReceiver;
private SignalServiceMessageSender messageSender;
@ -104,6 +106,11 @@ public class SignalDependencies {
ServiceConfig.AUTOMATIC_NETWORK_RETRY));
}
public Network getLibSignalNetwork() {
return getOrCreate(() -> libSignalNetwork,
() -> libSignalNetwork = new Network(serviceEnvironmentConfig.netEnvironment()));
}
public SignalServiceAccountManager getAccountManager() {
return getOrCreate(() -> accountManager,
() -> accountManager = new SignalServiceAccountManager(getPushServiceSocket(),

View file

@ -104,23 +104,6 @@ public class ContactRecordProcessor extends DefaultStorageRecordProcessor<Signal
profileFamilyName = local.getProfileFamilyName().orElse("");
}
String nicknameGivenName;
String nicknameFamilyName;
if (remote.getNicknameGivenName().isPresent()) {
nicknameGivenName = remote.getNicknameGivenName().orElse("");
nicknameFamilyName = remote.getNicknameFamilyName().orElse("");
} else {
nicknameGivenName = local.getNicknameGivenName().orElse("");
nicknameFamilyName = local.getNicknameFamilyName().orElse("");
}
if (nicknameGivenName.isBlank() && !nicknameFamilyName.isBlank()) {
logger.debug("Processed invalid nickname. Missing given name.");
nicknameGivenName = "";
nicknameFamilyName = "";
}
IdentityState identityState;
byte[] identityKey;
if (remote.getIdentityKey().isPresent() && (
@ -197,6 +180,8 @@ public class ContactRecordProcessor extends DefaultStorageRecordProcessor<Signal
? local.getSystemFamilyName().orElse("")
: remote.getSystemFamilyName().orElse("");
final var systemNickname = remote.getSystemNickname().orElse("");
final var nicknameGivenName = remote.getNicknameGivenName().orElse("");
final var nicknameFamilyName = remote.getNicknameFamilyName().orElse("");
final var pniSignatureVerified = remote.isPniSignatureVerified() || local.isPniSignatureVerified();
final var note = remote.getNote().or(local::getNote).orElse("");