X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fxdcc%2Fcore%2FCore.java;h=64fdbec791046a9c6195462440ad9e9f464424e2;hb=a3d06abf861a58f14bd4c9c06d33d5b101488858;hp=4d1e1ac5aafa2f64c083fd325baa5158631fd5ab;hpb=aa82fb99f45b296163464bff96bd130b7e02ce75;p=xudocci.git diff --git a/src/main/java/net/pterodactylus/xdcc/core/Core.java b/src/main/java/net/pterodactylus/xdcc/core/Core.java index 4d1e1ac..64fdbec 100644 --- a/src/main/java/net/pterodactylus/xdcc/core/Core.java +++ b/src/main/java/net/pterodactylus/xdcc/core/Core.java @@ -36,6 +36,7 @@ import net.pterodactylus.irc.DccReceiver; import net.pterodactylus.irc.event.ChannelJoined; import net.pterodactylus.irc.event.ChannelLeft; import net.pterodactylus.irc.event.ChannelMessageReceived; +import net.pterodactylus.irc.event.ClientQuit; import net.pterodactylus.irc.event.ConnectionEstablished; import net.pterodactylus.irc.event.DccDownloadFailed; import net.pterodactylus.irc.event.DccDownloadFinished; @@ -344,6 +345,22 @@ public class Core extends AbstractIdleService { } /** + * Removes a client (which may be a bot) from the table of known bots. + * + * @param clientQuit + * The client quit event + */ + @Subscribe + public void clientQuit(ClientQuit clientQuit) { + Optional network = getNetwork(clientQuit.connection()); + if (!network.isPresent()) { + return; + } + + networkBots.remove(network.get(), clientQuit.client().nick().get()); + } + + /** * If a message on a channel is received, it is parsed for pack information * with is then added to a bot. *