From: David ‘Bombe’ Roden Date: Wed, 15 Oct 2014 19:43:12 +0000 (+0200) Subject: Log message if a channel could not be joined. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=c45f3f052f1ade1291732bc92e14e6c741a564ff;p=xudocci.git Log message if a channel could not be joined. --- diff --git a/src/main/java/net/pterodactylus/xdcc/core/Core.java b/src/main/java/net/pterodactylus/xdcc/core/Core.java index 1822ee6..171683b 100644 --- a/src/main/java/net/pterodactylus/xdcc/core/Core.java +++ b/src/main/java/net/pterodactylus/xdcc/core/Core.java @@ -537,6 +537,18 @@ public class Core extends AbstractExecutionThreadService { } } + @Subscribe + public void channelNotJoined(ChannelNotJoined channelNotJoined) { + Optional network = getNetwork(channelNotJoined.connection()); + if (!network.isPresent()) { + return; + } + + eventBus.post(new GenericMessage( + format("Could not join %s/%s: %s", channelNotJoined.channel(), + network.get(), channelNotJoined.reason()))); + } + /** * Removes bots that leave a channel, or channels when it’s us that’s leaving. *