From: David ‘Bombe’ Roden Date: Wed, 10 Apr 2013 04:49:41 +0000 (+0200) Subject: Add command to initiate a download from a bot. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=b6ad408e63b624d6dae76c0c622a81574ccc429a;p=xudocci.git Add command to initiate a download from a bot. --- diff --git a/src/main/java/net/pterodactylus/xdcc/core/Core.java b/src/main/java/net/pterodactylus/xdcc/core/Core.java index 8eea508..ecf0946 100644 --- a/src/main/java/net/pterodactylus/xdcc/core/Core.java +++ b/src/main/java/net/pterodactylus/xdcc/core/Core.java @@ -124,6 +124,27 @@ public class Core extends AbstractIdleService { channels.add(channel); } + /** + * Fetches the given pack from the given bot. + * + * @param bot + * The bot to fetch the pack from + * @param pack + * The pack to fetch + */ + public void fetch(Bot bot, Pack pack) { + Connection connection = networkConnections.get(bot.network()); + if (connection == null) { + return; + } + + try { + connection.sendMessage(bot.name(), "XDCC SEND " + pack.id()); + } catch (IOException ioe1) { + logger.log(Level.WARNING, "Could not send message to bot!", ioe1); + } + } + // // ABSTRACTIDLESERVICE METHODS //