projects
/
xudocci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Notify main loop when we leave a channel.
[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
f7b0595
..
1038b4f
100644
(file)
--- a/
src/main/java/net/pterodactylus/xdcc/core/Core.java
+++ b/
src/main/java/net/pterodactylus/xdcc/core/Core.java
@@
-571,6
+571,9
@@
public class Core extends AbstractExecutionThreadService {
public void connectionClosed(ConnectionClosed connectionClosed) {
connectionBackoff.connectionFailed(getNetwork(connectionClosed.connection()).get());
removeConnection(connectionClosed.connection());
public void connectionClosed(ConnectionClosed connectionClosed) {
connectionBackoff.connectionFailed(getNetwork(connectionClosed.connection()).get());
removeConnection(connectionClosed.connection());
+ synchronized (syncObject) {
+ syncObject.notifyAll();
+ }
eventBus.post(new GenericMessage(String.format("Connection closed by %s.", connectionClosed.connection().hostname())));
}
eventBus.post(new GenericMessage(String.format("Connection closed by %s.", connectionClosed.connection().hostname())));
}
@@
-584,6
+587,9
@@
public class Core extends AbstractExecutionThreadService {
public void connectionFailed(ConnectionFailed connectionFailed) {
connectionBackoff.connectionFailed(getNetwork(connectionFailed.connection()).get());
removeConnection(connectionFailed.connection());
public void connectionFailed(ConnectionFailed connectionFailed) {
connectionBackoff.connectionFailed(getNetwork(connectionFailed.connection()).get());
removeConnection(connectionFailed.connection());
+ synchronized (syncObject) {
+ syncObject.notifyAll();
+ }
eventBus.post(new GenericMessage(String.format("Could not connect to %s: %s.", connectionFailed.connection().hostname(), connectionFailed.cause())));
}
eventBus.post(new GenericMessage(String.format("Could not connect to %s: %s.", connectionFailed.connection().hostname(), connectionFailed.cause())));
}
@@
-625,11
+631,14
@@
public class Core extends AbstractExecutionThreadService {
Optional<Channel> channel = getChannel(network.get(), channelNotJoined.channel());
if (!channel.isPresent()) {
Optional<Channel> channel = getChannel(network.get(), channelNotJoined.channel());
if (!channel.isPresent()) {
- eventBus.post(new GenericMessage(format("Could not join %s but didn’t try to join, either.", channel
.get
())));
+ eventBus.post(new GenericMessage(format("Could not join %s but didn’t try to join, either.", channel
NotJoined.channel
())));
return;
}
channelsBeingJoined.remove(channel.get());
return;
}
channelsBeingJoined.remove(channel.get());
+ synchronized (syncObject) {
+ syncObject.notifyAll();
+ }
/* remove all bots for this channel, we might have been kicked. */
Collection<Bot> botsToRemove = networkBots.row(network.get())
/* remove all bots for this channel, we might have been kicked. */
Collection<Bot> botsToRemove = networkBots.row(network.get())
@@
-690,6
+699,9
@@
public class Core extends AbstractExecutionThreadService {
} else {
channels.remove(channel.get());
}
} else {
channels.remove(channel.get());
}
+ synchronized (syncObject) {
+ syncObject.notifyAll();
+ }
eventBus.post(new GenericMessage(String.format("Left Channel %s on %s.", channel.get().name(), channel.get().network().name())));
}
eventBus.post(new GenericMessage(String.format("Left Channel %s on %s.", channel.get().name(), channel.get().network().name())));
}
@@
-722,6
+734,9
@@
public class Core extends AbstractExecutionThreadService {
} else {
joinedChannels.remove(channel.get());
}
} else {
joinedChannels.remove(channel.get());
}
+ synchronized (syncObject) {
+ syncObject.notifyAll();
+ }
eventBus.post(new GenericMessage(format(
"Kicked from %s by %s: %s",
kickedFromChannel.channel(),
eventBus.post(new GenericMessage(format(
"Kicked from %s by %s: %s",
kickedFromChannel.channel(),