This commit is contained in:
Andrea Cavalli 2022-09-13 22:38:50 +02:00
parent c7c2b03ef1
commit ed49893515
2 changed files with 3 additions and 3 deletions

View File

@ -34,7 +34,7 @@
<dependency> <dependency>
<groupId>it.tdlight</groupId> <groupId>it.tdlight</groupId>
<artifactId>tdlight-java-bom</artifactId> <artifactId>tdlight-java-bom</artifactId>
<version>2.8.5.1</version> <version>2.8.5.2</version>
<type>pom</type> <type>pom</type>
<scope>import</scope> <scope>import</scope>
</dependency> </dependency>

View File

@ -262,11 +262,11 @@ public final class InternalReactiveClient implements ClientEventsHandler, Reacti
public void setListener(SignalListener listener) { public void setListener(SignalListener listener) {
logger.debug(TG_MARKER, "Setting handler of client {}", clientId); logger.debug(TG_MARKER, "Setting handler of client {}", clientId);
var prevSignalListener = this.signalListener; SignalListener prevSignalListener = this.signalListener;
if (!(prevSignalListener instanceof ReplayStartupUpdatesListener)) { if (!(prevSignalListener instanceof ReplayStartupUpdatesListener)) {
throw new IllegalStateException("Already subscribed"); throw new IllegalStateException("Already subscribed");
} }
var replayStartupUpdatesListener = (ReplayStartupUpdatesListener) prevSignalListener; ReplayStartupUpdatesListener replayStartupUpdatesListener = (ReplayStartupUpdatesListener) prevSignalListener;
// Set the new listener into the startup listener, then drain its startup queue // Set the new listener into the startup listener, then drain its startup queue
replayStartupUpdatesListener.setNewListener(listener); replayStartupUpdatesListener.setNewListener(listener);
replayStartupUpdatesListener.drain(); replayStartupUpdatesListener.drain();