Show a message when a bot has quit IRC.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 13 Apr 2013 10:34:06 +0000 (12:34 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 13 Apr 2013 10:34:06 +0000 (12:34 +0200)
src/main/java/net/pterodactylus/xdcc/core/Core.java

index 251310e..5485ed4 100644 (file)
@@ -359,7 +359,10 @@ public class Core extends AbstractIdleService {
                        return;
                }
 
-               networkBots.remove(network.get(), clientQuit.client().nick().get());
+               Bot removedBot = networkBots.remove(network.get(), clientQuit.client().nick().get());
+               if (removedBot != null) {
+                       eventBus.post(new GenericMessage(String.format("Bot %s (%s) was removed, %d packs removed.", removedBot.name(), removedBot.network().name(), removedBot.packs().size())));
+               }
        }
 
        /**