From 2769f52b856c2ebb1ec06836ca81591b7e99a4ba Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Tue, 13 Jan 2015 22:12:07 +0100 Subject: [PATCH] Treat invite-only channels as banned. --- src/main/java/net/pterodactylus/xdcc/core/Core.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/net/pterodactylus/xdcc/core/Core.java b/src/main/java/net/pterodactylus/xdcc/core/Core.java index e24fa2f..b020c1a 100644 --- a/src/main/java/net/pterodactylus/xdcc/core/Core.java +++ b/src/main/java/net/pterodactylus/xdcc/core/Core.java @@ -19,6 +19,7 @@ package net.pterodactylus.xdcc.core; import static java.lang.String.format; import static net.pterodactylus.irc.event.ChannelNotJoined.Reason.banned; +import static net.pterodactylus.irc.event.ChannelNotJoined.Reason.inviteOnly; 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; @@ -660,6 +661,13 @@ public class Core extends AbstractExecutionThreadService { format("Not trying to join %s anymore.", channel.get()))); return; } + if (channelNotJoined.reason() == inviteOnly) { + channelBanManager.ban(channel.get()); + eventBus.post(new GenericMessage( + format("%s is invite-only, suspending join for a day.", + channel.get()))); + return; + } if (channelNotJoined.reason() == banned) { channelBanManager.ban(channel.get()); eventBus.post(new GenericMessage( -- 2.7.4