Add command to initiate a download from a bot.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 10 Apr 2013 04:49:41 +0000 (06:49 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 10 Apr 2013 04:49:41 +0000 (06:49 +0200)
src/main/java/net/pterodactylus/xdcc/core/Core.java

index 8eea508..ecf0946 100644 (file)
@@ -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
        //