Log message if a channel could not be joined.
[xudocci.git] / 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.
         *