projects
/
xudocci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Only download as much bytes as advertised.
[xudocci.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
xdcc
/
core
/
Core.java
diff --git
a/src/main/java/net/pterodactylus/xdcc/core/Core.java
b/src/main/java/net/pterodactylus/xdcc/core/Core.java
index
96555e3
..
d253148
100644
(file)
--- a/
src/main/java/net/pterodactylus/xdcc/core/Core.java
+++ b/
src/main/java/net/pterodactylus/xdcc/core/Core.java
@@
-78,6
+78,9
@@
public class Core extends AbstractIdleService {
/** The channels that are currentlymonitored. */
private final Collection<Channel> joinedChannels = Sets.newHashSet();
/** 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());
/** The current network connections. */
private final Map<Network, Connection> networkConnections = Collections.synchronizedMap(Maps.<Network, Connection>newHashMap());
@@
-122,6
+125,15
@@
public class Core extends AbstractIdleService {
}
/**
}
/**
+ * 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
* Returns all currently known bots.
*
* @return All currently known bots
@@
-251,6
+263,9
@@
public class Core extends AbstractIdleService {
Optional<Channel> channel = getChannel(network.get(), channelJoined.channel());
if (!channel.isPresent()) {
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;
}
return;
}