projects
/
xudocci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make copies of lists before iterating.
[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
39dc3ad
..
6af2f73
100644
(file)
--- a/
src/main/java/net/pterodactylus/xdcc/core/Core.java
+++ b/
src/main/java/net/pterodactylus/xdcc/core/Core.java
@@
-48,8
+48,8
@@
import net.pterodactylus.irc.event.DccDownloadFailed;
import net.pterodactylus.irc.event.DccDownloadFinished;
import net.pterodactylus.irc.event.DccSendReceived;
import net.pterodactylus.irc.event.NicknameChanged;
import net.pterodactylus.irc.event.DccDownloadFinished;
import net.pterodactylus.irc.event.DccSendReceived;
import net.pterodactylus.irc.event.NicknameChanged;
-import net.pterodactylus.irc.event.PrivateNoticeReceived;
import net.pterodactylus.irc.event.PrivateMessageReceived;
import net.pterodactylus.irc.event.PrivateMessageReceived;
+import net.pterodactylus.irc.event.PrivateNoticeReceived;
import net.pterodactylus.irc.util.MessageCleaner;
import net.pterodactylus.irc.util.RandomNickname;
import net.pterodactylus.xdcc.core.event.BotAdded;
import net.pterodactylus.irc.util.MessageCleaner;
import net.pterodactylus.irc.util.RandomNickname;
import net.pterodactylus.xdcc.core.event.BotAdded;
@@
-147,6
+147,15
@@
public class Core extends AbstractExecutionThreadService {
//
/**
//
/**
+ * Returns all currently known connections.
+ *
+ * @return All currently known connections
+ */
+ public Collection<Connection> connections() {
+ return networkConnections.values();
+ }
+
+ /**
* Returns all configured channels. Due to various circumstances, configured
* channels might not actually be joined.
*
* Returns all configured channels. Due to various circumstances, configured
* channels might not actually be joined.
*
@@
-249,6
+258,20
@@
public class Core extends AbstractExecutionThreadService {
}
}
}
}
+ /**
+ * Closes the given connection.
+ *
+ * @param connection
+ * The connection to close
+ */
+ public void closeConnection(Connection connection) {
+ try {
+ connection.close();
+ } catch (IOException ioe1) {
+ /* TODO */
+ }
+ }
+
//
// ABSTRACTIDLESERVICE METHODS
//
//
// ABSTRACTIDLESERVICE METHODS
//
@@
-571,7
+594,7
@@
public class Core extends AbstractExecutionThreadService {
return;
}
return;
}
- eventBus.post(new GenericMessage(String.format("Notice from %s (%s): %s", privateNoticeReceived.reply().source(), network.get(), privateNoticeReceived.text())));
+ eventBus.post(new GenericMessage(String.format("Notice from %s (%s): %s", privateNoticeReceived.reply().source()
.get()
, network.get(), privateNoticeReceived.text())));
}
/**
}
/**