if (!network.isPresent()) {
return;
}
+ if (!connection.established()) {
+ return;
+ }
/* find all channels that need to be removed. */
for (Collection<Channel> channels : ImmutableList.of(joinedChannels, extraChannels)) {
return;
}
+ 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())));
+ return;
+ }
+
if (channelNotJoined.reason() == registeredNicknamesOnly) {
- Optional<Channel> channel = getChannel(network.get(), channelNotJoined.channel());
- if (channel.isPresent()) {
- eventBus.post(new GenericMessage(format("Not trying to join %s anymore.", channel.get())));
- channels.remove(channel.get());
- }
+ channels.remove(channel.get());
+ eventBus.post(new GenericMessage(
+ format("Not trying to join %s anymore.", channel.get())));
return;
}
if (channelNotJoined.reason() == banned) {