Expose currently joined channels.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 10 Apr 2013 06:23:09 +0000 (08:23 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 10 Apr 2013 06:27:05 +0000 (08:27 +0200)
src/main/java/net/pterodactylus/xdcc/core/Core.java

index e417f83..de4c842 100644 (file)
@@ -74,6 +74,9 @@ public class Core extends AbstractIdleService {
        /** The channels that should be monitored. */
        private final Collection<Channel> channels = Sets.newHashSet();
 
+       /** The channels that are currentlymonitored. */
+       private final Collection<Channel> joinedChannels = Sets.newHashSet();
+
        /** The current network connections. */
        private final Map<Network, Connection> networkConnections = Collections.synchronizedMap(Maps.<Network, Connection>newHashMap());
 
@@ -109,6 +112,15 @@ public class Core extends AbstractIdleService {
        }
 
        /**
+        * Returns all currently joined channels.
+        *
+        * @return All currently joined channels
+        */
+       public Collection<Channel> joinedChannels() {
+               return ImmutableSet.copyOf(joinedChannels);
+       }
+
+       /**
         * Returns all currently known bots.
         *
         * @return All currently known bots