import org.whispersystems.signalservice.api.SignalServiceMessageSender;
import org.whispersystems.signalservice.api.SignalSessionLock;
import org.whispersystems.signalservice.api.account.AccountApi;
+import org.whispersystems.signalservice.api.attachment.AttachmentApi;
import org.whispersystems.signalservice.api.cds.CdsApi;
+import org.whispersystems.signalservice.api.certificate.CertificateApi;
import org.whispersystems.signalservice.api.crypto.SignalServiceCipher;
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.keys.KeysApi;
import org.whispersystems.signalservice.api.link.LinkDeviceApi;
+import org.whispersystems.signalservice.api.message.MessageApi;
+import org.whispersystems.signalservice.api.profiles.ProfileApi;
import org.whispersystems.signalservice.api.push.ServiceIdType;
import org.whispersystems.signalservice.api.push.SignalServiceAddress;
import org.whispersystems.signalservice.api.ratelimit.RateLimitChallengeApi;
private RegistrationApi registrationApi;
private LinkDeviceApi linkDeviceApi;
private StorageServiceApi storageServiceApi;
+ private CertificateApi certificateApi;
+ private AttachmentApi attachmentApi;
+ private MessageApi messageApi;
+ private KeysApi keysApi;
private GroupsV2Operations groupsV2Operations;
private ClientZkOperations clientZkOperations;
private List<SecureValueRecovery> secureValueRecovery;
private ProfileService profileService;
+ private ProfileApi profileApi;
SignalDependencies(
final ServiceEnvironmentConfig serviceEnvironmentConfig,
() -> pushServiceSocket = new PushServiceSocket(serviceEnvironmentConfig.signalServiceConfiguration(),
credentialsProvider,
userAgent,
- getClientZkProfileOperations(),
ServiceConfig.AUTOMATIC_NETWORK_RETRY));
}
public SignalServiceAccountManager getAccountManager() {
return getOrCreate(() -> accountManager,
- () -> accountManager = new SignalServiceAccountManager(getAccountApi(),
+ () -> accountManager = new SignalServiceAccountManager(getAuthenticatedSignalWebSocket(),
+ getAccountApi(),
getPushServiceSocket(),
getGroupsV2Operations()));
}
return new StorageServiceRepository(getStorageServiceApi());
}
+ public CertificateApi getCertificateApi() {
+ return getOrCreate(() -> certificateApi,
+ () -> certificateApi = new CertificateApi(getAuthenticatedSignalWebSocket()));
+ }
+
+ public AttachmentApi getAttachmentApi() {
+ return getOrCreate(() -> attachmentApi,
+ () -> attachmentApi = new AttachmentApi(getAuthenticatedSignalWebSocket(), getPushServiceSocket()));
+ }
+
+ public MessageApi getMessageApi() {
+ return getOrCreate(() -> messageApi,
+ () -> messageApi = new MessageApi(getAuthenticatedSignalWebSocket(),
+ getUnauthenticatedSignalWebSocket()));
+ }
+
+ public KeysApi getKeysApi() {
+ return getOrCreate(() -> keysApi,
+ () -> keysApi = new KeysApi(getAuthenticatedSignalWebSocket(), getUnauthenticatedSignalWebSocket()));
+ }
+
public GroupsV2Operations getGroupsV2Operations() {
return getOrCreate(() -> groupsV2Operations,
() -> groupsV2Operations = new GroupsV2Operations(ClientZkOperations.create(serviceEnvironmentConfig.signalServiceConfiguration()),
Optional.of(credentialsProvider),
userAgent,
healthMonitor,
- allowStories), timer, TimeUnit.SECONDS.toMillis(10));
+ allowStories), () -> true, timer, TimeUnit.SECONDS.toMillis(10));
healthMonitor.monitor(authenticatedSignalWebSocket);
});
}
Optional.empty(),
userAgent,
healthMonitor,
- allowStories), timer, TimeUnit.SECONDS.toMillis(10));
+ allowStories), () -> true, timer, TimeUnit.SECONDS.toMillis(10));
healthMonitor.monitor(unauthenticatedSignalWebSocket);
});
}
() -> messageSender = new SignalServiceMessageSender(getPushServiceSocket(),
dataStore,
sessionLock,
- getAuthenticatedSignalWebSocket(),
- getUnauthenticatedSignalWebSocket(),
+ getAttachmentApi(),
+ getMessageApi(),
+ getKeysApi(),
Optional.empty(),
executor,
- ServiceConfig.MAX_ENVELOPE_SIZE));
+ ServiceConfig.MAX_ENVELOPE_SIZE,
+ () -> true));
}
public List<SecureValueRecovery> getSecureValueRecovery() {
.toList());
}
+ public ProfileApi getProfileApi() {
+ return getOrCreate(() -> profileApi,
+ () -> profileApi = new ProfileApi(getAuthenticatedSignalWebSocket(),
+ getUnauthenticatedSignalWebSocket(),
+ getPushServiceSocket(),
+ getClientZkProfileOperations()));
+ }
+
public ProfileService getProfileService() {
return getOrCreate(() -> profileService,
() -> profileService = new ProfileService(getClientZkProfileOperations(),
- getMessageReceiver(),
getAuthenticatedSignalWebSocket(),
getUnauthenticatedSignalWebSocket()));
}