From: David ‘Bombe’ Roden Date: Sat, 13 Apr 2013 10:34:50 +0000 (+0200) Subject: Show a message when a bot has left a channel. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=073337dd8309e3d6e2cf57b9a763de7de679a6a9;p=xudocci.git Show a message when a bot has left a channel. --- diff --git a/src/main/java/net/pterodactylus/xdcc/core/Core.java b/src/main/java/net/pterodactylus/xdcc/core/Core.java index 5485ed4..dce8da3 100644 --- a/src/main/java/net/pterodactylus/xdcc/core/Core.java +++ b/src/main/java/net/pterodactylus/xdcc/core/Core.java @@ -343,7 +343,10 @@ public class Core extends AbstractIdleService { return; } - networkBots.remove(network.get(), channelLeft.client().nick().get()); + Bot removedBot = networkBots.remove(network.get(), channelLeft.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()))); + } } /**