import org.whispersystems.signalservice.api.groupsv2.ClientZkOperations;
import org.whispersystems.signalservice.api.groupsv2.GroupsV2Api;
import org.whispersystems.signalservice.api.groupsv2.GroupsV2Operations;
+import org.whispersystems.signalservice.api.link.LinkDeviceApi;
import org.whispersystems.signalservice.api.push.ServiceIdType;
import org.whispersystems.signalservice.api.push.SignalServiceAddress;
+import org.whispersystems.signalservice.api.registration.RegistrationApi;
import org.whispersystems.signalservice.api.services.ProfileService;
+import org.whispersystems.signalservice.api.storage.StorageServiceApi;
+import org.whispersystems.signalservice.api.storage.StorageServiceRepository;
import org.whispersystems.signalservice.api.svr.SecureValueRecovery;
import org.whispersystems.signalservice.api.util.CredentialsProvider;
import org.whispersystems.signalservice.api.util.UptimeSleepTimer;
private SignalServiceAccountManager accountManager;
private GroupsV2Api groupsV2Api;
+ private RegistrationApi registrationApi;
+ private LinkDeviceApi linkDeviceApi;
+ private StorageServiceApi storageServiceApi;
private GroupsV2Operations groupsV2Operations;
private ClientZkOperations clientZkOperations;
private SignalServiceMessageReceiver messageReceiver;
private SignalServiceMessageSender messageSender;
- private List<SecureValueRecovery> secureValueRecoveryV2;
+ private List<SecureValueRecovery> secureValueRecovery;
private ProfileService profileService;
SignalDependencies(
if (this.pushServiceSocket != null) {
this.pushServiceSocket.close();
this.pushServiceSocket = null;
+ this.accountManager = null;
+ this.messageReceiver = null;
+ this.messageSender = null;
+ this.profileService = null;
+ this.groupsV2Api = null;
+ this.registrationApi = null;
+ this.secureValueRecovery = null;
}
- this.messageSender = null;
getSignalWebSocket().forceNewWebSockets();
}
return getOrCreate(() -> groupsV2Api, () -> groupsV2Api = getAccountManager().getGroupsV2Api());
}
+ public RegistrationApi getRegistrationApi() {
+ return getOrCreate(() -> registrationApi, () -> registrationApi = getAccountManager().getRegistrationApi());
+ }
+
+ public LinkDeviceApi getLinkDeviceApi() {
+ return getOrCreate(() -> linkDeviceApi, () -> linkDeviceApi = new LinkDeviceApi(getPushServiceSocket()));
+ }
+
+ private StorageServiceApi getStorageServiceApi() {
+ return getOrCreate(() -> storageServiceApi,
+ () -> storageServiceApi = new StorageServiceApi(getPushServiceSocket()));
+ }
+
+ public StorageServiceRepository getStorageServiceRepository() {
+ return new StorageServiceRepository(getStorageServiceApi());
+ }
+
public GroupsV2Operations getGroupsV2Operations() {
return getOrCreate(() -> groupsV2Operations,
() -> groupsV2Operations = new GroupsV2Operations(ClientZkOperations.create(serviceEnvironmentConfig.signalServiceConfiguration()),
ServiceConfig.MAX_ENVELOPE_SIZE));
}
- public List<SecureValueRecovery> getSecureValueRecoveryV2() {
- return getOrCreate(() -> secureValueRecoveryV2,
- () -> secureValueRecoveryV2 = serviceEnvironmentConfig.svr2Mrenclaves()
+ public List<SecureValueRecovery> getSecureValueRecovery() {
+ return getOrCreate(() -> secureValueRecovery,
+ () -> secureValueRecovery = serviceEnvironmentConfig.svr2Mrenclaves()
.stream()
.map(mr -> (SecureValueRecovery) getAccountManager().getSecureValueRecoveryV2(mr))
.toList());