From: David ‘Bombe’ Roden Date: Wed, 15 Oct 2014 20:24:29 +0000 (+0200) Subject: Remove channel from joined channels when we were kicked. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=0e84cf6dbee5bc509d5e3d64c3347a3046810d9d;p=xudocci.git Remove channel from joined channels when we were kicked. --- diff --git a/src/main/java/net/pterodactylus/xdcc/core/Core.java b/src/main/java/net/pterodactylus/xdcc/core/Core.java index ac9ac4d..8d983d5 100644 --- a/src/main/java/net/pterodactylus/xdcc/core/Core.java +++ b/src/main/java/net/pterodactylus/xdcc/core/Core.java @@ -599,6 +599,19 @@ public class Core extends AbstractExecutionThreadService { /* have we been kicked? */ if (nicknameMatchesConnection(kickedFromChannel.connection(), kickedFromChannel.kickee())) { + Optional channel = getChannel(network.get(), kickedFromChannel.channel()); + if (!channel.isPresent()) { + /* maybe it was an extra channel? */ + channel = getExtraChannel(network.get(), kickedFromChannel.channel()); + if (!channel.isPresent()) { + /* okay, whatever. */ + return; + } + + extraChannels.remove(channel); + } else { + channels.remove(channel.get()); + } eventBus.post(new GenericMessage(format( "Kicked from %s/%s by %s: %s", kickedFromChannel.channel(), network.get(),