Log message if a channel could not be joined.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 15 Oct 2014 19:43:12 +0000 (21:43 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 15 Oct 2014 19:43:12 +0000 (21:43 +0200)
src/main/java/net/pterodactylus/xdcc/core/Core.java

index 1822ee6..171683b 100644 (file)
@@ -537,6 +537,18 @@ public class Core extends AbstractExecutionThreadService {
                }
        }
 
+       @Subscribe
+       public void channelNotJoined(ChannelNotJoined channelNotJoined) {
+               Optional<Network> 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.
         *