/** The channels that are currentlymonitored. */
private final Collection<Channel> joinedChannels = Sets.newHashSet();
+ /** The channels that are joined but not configured. */
+ private final Collection<Channel> extraChannels = Sets.newHashSet();
+
/** The current network connections. */
private final Map<Network, Connection> networkConnections = Collections.synchronizedMap(Maps.<Network, Connection>newHashMap());
}
/**
+ * Returns all currently joined channels that are not configured.
+ *
+ * @return All currently joined but not configured channels
+ */
+ public Collection<Channel> extraChannels() {
+ return ImmutableSet.copyOf(extraChannels);
+ }
+
+ /**
* Returns all currently known bots.
*
* @return All currently known bots
Optional<Channel> channel = getChannel(network.get(), channelJoined.channel());
if (!channel.isPresent()) {
+ /* it’s an extra channel. */
+ extraChannels.add(new Channel(network.get(), channelJoined.channel()));
+ logger.info(String.format("Joined extra Channel %s on %s.", channelJoined.channel(), network.get().name()));
return;
}