Update libsignal-service

This commit is contained in:
AsamK 2024-05-09 21:07:17 +02:00
parent fb81bf1d05
commit 8f756cd90c
4 changed files with 15 additions and 9 deletions

View file

@ -23,6 +23,8 @@ import org.whispersystems.signalservice.api.util.CredentialsProvider;
import org.whispersystems.signalservice.api.util.UptimeSleepTimer;
import org.whispersystems.signalservice.api.websocket.WebSocketFactory;
import org.whispersystems.signalservice.internal.push.PushServiceSocket;
import org.whispersystems.signalservice.internal.websocket.LibSignalNetwork;
import org.whispersystems.signalservice.internal.websocket.OkHttpWebSocketConnection;
import org.whispersystems.signalservice.internal.websocket.WebSocketConnection;
import java.util.List;
@ -49,7 +51,7 @@ public class SignalDependencies {
private ClientZkOperations clientZkOperations;
private PushServiceSocket pushServiceSocket;
private Network libSignalNetwork;
private LibSignalNetwork libSignalNetwork;
private SignalWebSocket signalWebSocket;
private SignalServiceMessageReceiver messageReceiver;
private SignalServiceMessageSender messageSender;
@ -106,9 +108,10 @@ public class SignalDependencies {
ServiceConfig.AUTOMATIC_NETWORK_RETRY));
}
public Network getLibSignalNetwork() {
public LibSignalNetwork getLibSignalNetwork() {
return getOrCreate(() -> libSignalNetwork,
() -> libSignalNetwork = new Network(serviceEnvironmentConfig.netEnvironment()));
() -> libSignalNetwork = new LibSignalNetwork(new Network(serviceEnvironmentConfig.netEnvironment(),
userAgent), serviceEnvironmentConfig.signalServiceConfiguration()));
}
public SignalServiceAccountManager getAccountManager() {
@ -159,7 +162,7 @@ public class SignalDependencies {
final var webSocketFactory = new WebSocketFactory() {
@Override
public WebSocketConnection createWebSocket() {
return new WebSocketConnection("normal",
return new OkHttpWebSocketConnection("normal",
serviceEnvironmentConfig.signalServiceConfiguration(),
Optional.of(credentialsProvider),
userAgent,
@ -169,7 +172,7 @@ public class SignalDependencies {
@Override
public WebSocketConnection createUnidentifiedWebSocket() {
return new WebSocketConnection("unidentified",
return new OkHttpWebSocketConnection("unidentified",
serviceEnvironmentConfig.signalServiceConfiguration(),
Optional.empty(),
userAgent,

View file

@ -7,7 +7,7 @@ import org.whispersystems.signalservice.api.util.Preconditions;
import org.whispersystems.signalservice.api.util.SleepTimer;
import org.whispersystems.signalservice.api.websocket.HealthMonitor;
import org.whispersystems.signalservice.api.websocket.WebSocketConnectionState;
import org.whispersystems.signalservice.internal.websocket.WebSocketConnection;
import org.whispersystems.signalservice.internal.websocket.OkHttpWebSocketConnection;
import java.util.Arrays;
import java.util.concurrent.TimeUnit;
@ -25,7 +25,7 @@ final class SignalWebSocketHealthMonitor implements HealthMonitor {
private static final Logger logger = LoggerFactory.getLogger(SignalWebSocketHealthMonitor.class);
private static final long KEEP_ALIVE_SEND_CADENCE = TimeUnit.SECONDS.toMillis(WebSocketConnection.KEEPALIVE_FREQUENCY_SECONDS);
private static final long KEEP_ALIVE_SEND_CADENCE = TimeUnit.SECONDS.toMillis(OkHttpWebSocketConnection.KEEPALIVE_FREQUENCY_SECONDS);
private static final long MAX_TIME_SINCE_SUCCESSFUL_KEEP_ALIVE = KEEP_ALIVE_SEND_CADENCE * 3;
private SignalWebSocket signalWebSocket;