X-Git-Url: https://git.nmode.ca/signal-cli/blobdiff_plain/3f7d8c60b9dc48d4aa9d81e065c0cf189af4d070..9ffacfe90e54a86da289d3e6fb3c3df738f57abb:/lib/src/main/java/org/asamk/signal/manager/SignalDependencies.java diff --git a/lib/src/main/java/org/asamk/signal/manager/SignalDependencies.java b/lib/src/main/java/org/asamk/signal/manager/SignalDependencies.java index 6450f1f8..3b3b375a 100644 --- a/lib/src/main/java/org/asamk/signal/manager/SignalDependencies.java +++ b/lib/src/main/java/org/asamk/signal/manager/SignalDependencies.java @@ -40,6 +40,8 @@ public class SignalDependencies { private final ExecutorService executor; private final SignalSessionLock sessionLock; + private boolean allowStories = true; + private SignalServiceAccountManager accountManager; private GroupsV2Api groupsV2Api; private GroupsV2Operations groupsV2Operations; @@ -72,6 +74,14 @@ public class SignalDependencies { public void resetAfterAddressChange() { this.messageSender = null; this.cipher = null; + getSignalWebSocket().forceNewWebSockets(); + } + + /** + * This method needs to be called before the first websocket is created + */ + public void setAllowStories(final boolean allowStories) { + this.allowStories = allowStories; } public ServiceEnvironmentConfig getServiceEnvironmentConfig() { @@ -135,7 +145,7 @@ public class SignalDependencies { Optional.of(credentialsProvider), userAgent, healthMonitor, - true); + allowStories); } @Override @@ -145,7 +155,7 @@ public class SignalDependencies { Optional.empty(), userAgent, healthMonitor, - true); + allowStories); } }; signalWebSocket = new SignalWebSocket(webSocketFactory);