Use LibSignalChatConnection for Authenticated Socket based on Remote Config

This commit is contained in:
andrew-signal
2024-12-05 09:27:31 -05:00
committed by Greyson Parrelli
parent 9389f373c6
commit 080b79c893
6 changed files with 278 additions and 44 deletions

View File

@@ -408,12 +408,23 @@ public class ApplicationDependencyProvider implements AppDependencies.Provider {
return new WebSocketFactory() {
@Override
public WebSocketConnection createWebSocket() {
return new OkHttpWebSocketConnection("normal",
signalServiceConfigurationSupplier.get(),
Optional.of(new DynamicCredentialsProvider()),
BuildConfig.SIGNAL_AGENT,
healthMonitor,
Stories.isFeatureEnabled());
if (RemoteConfig.libSignalWebSocketEnabled()) {
Network network = libSignalNetworkSupplier.get();
return new LibSignalChatConnection(
"libsignal-auth",
network,
new DynamicCredentialsProvider(),
Stories.isFeatureEnabled(),
healthMonitor
);
} else {
return new OkHttpWebSocketConnection("normal",
signalServiceConfigurationSupplier.get(),
Optional.of(new DynamicCredentialsProvider()),
BuildConfig.SIGNAL_AGENT,
healthMonitor,
Stories.isFeatureEnabled());
}
}
@Override