Expose DCC receivers from core.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 10 Apr 2013 04:47:43 +0000 (06:47 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 10 Apr 2013 04:47:43 +0000 (06:47 +0200)
src/main/java/net/pterodactylus/xdcc/core/Core.java

index 5df7f42..8eea508 100644 (file)
@@ -28,6 +28,7 @@ import java.util.logging.Logger;
 
 import net.pterodactylus.irc.Connection;
 import net.pterodactylus.irc.ConnectionBuilder;
+import net.pterodactylus.irc.DccReceiver;
 import net.pterodactylus.irc.event.ChannelMessageReceived;
 import net.pterodactylus.irc.event.ConnectionEstablished;
 import net.pterodactylus.irc.util.MessageCleaner;
@@ -73,6 +74,9 @@ public class Core extends AbstractIdleService {
        /** The currently known bots. */
        private final Table<Network, String, Bot> networkBots = HashBasedTable.create();
 
+       /** The current DCC receivers. */
+       private final Collection<DccReceiver> dccReceivers = Sets.newHashSet();
+
        /**
         * Creates a new core.
         *
@@ -97,6 +101,15 @@ public class Core extends AbstractIdleService {
                return networkBots.values();
        }
 
+       /**
+        * Returns the currently active DCC receivers.
+        *
+        * @return The currently active DCC receivers
+        */
+       public Collection<DccReceiver> dccReceivers() {
+               return dccReceivers;
+       }
+
        //
        // ACTIONS
        //