From 9ce99900a9d1401c91db97d4de194452c4689526 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 17 Oct 2014 09:38:27 +0200 Subject: [PATCH] =?utf8?q?Don=E2=80=99t=20try=20to=20join=20channels=20tha?= =?utf8?q?t=20require=20a=20registration=20anymore.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/java/net/pterodactylus/xdcc/core/Core.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/net/pterodactylus/xdcc/core/Core.java b/src/main/java/net/pterodactylus/xdcc/core/Core.java index 0cc8294..1ea95a9 100644 --- a/src/main/java/net/pterodactylus/xdcc/core/Core.java +++ b/src/main/java/net/pterodactylus/xdcc/core/Core.java @@ -18,6 +18,7 @@ package net.pterodactylus.xdcc.core; import static java.lang.String.format; +import static net.pterodactylus.irc.event.ChannelNotJoined.Reason.registeredNicknamesOnly; import static net.pterodactylus.irc.util.MessageCleaner.getDefaultInstance; import static net.pterodactylus.xdcc.data.Channel.TO_NETWORK; import static net.pterodactylus.xdcc.data.Download.FILTER_RUNNING; @@ -545,6 +546,15 @@ public class Core extends AbstractExecutionThreadService { return; } + if (channelNotJoined.reason() == registeredNicknamesOnly) { + Optional channel = getChannel(network.get(), channelNotJoined.channel()); + if (channel.isPresent()) { + eventBus.post(new GenericMessage(format("Not trying to join %s anymore.", channel.get()))); + channels.remove(channel.get()); + } + return; + } + eventBus.post(new GenericMessage( format("Could not join %s: %s", channelNotJoined.channel(), channelNotJoined.reason()))); -- 2.7.4