|
@@ -36,6 +36,7 @@ import com.dmdirc.interfaces.CommandController;
|
36
|
36
|
import com.dmdirc.interfaces.Connection;
|
37
|
37
|
import com.dmdirc.interfaces.WindowModel;
|
38
|
38
|
import com.dmdirc.parser.common.ChannelJoinRequest;
|
|
39
|
+import com.dmdirc.ui.WindowManager;
|
39
|
40
|
import com.dmdirc.ui.input.AdditionalTabTargets;
|
40
|
41
|
import com.dmdirc.ui.messages.Styliser;
|
41
|
42
|
|
|
@@ -69,6 +70,7 @@ public class JoinChannelCommand extends Command implements IntelligentCommand {
|
69
|
70
|
private final Multimap<WindowModel, String> mentions = ArrayListMultimap.create();
|
70
|
71
|
/** Lock to synchronise on when accessing mentions. */
|
71
|
72
|
private final Object mentionsLock = new Object();
|
|
73
|
+ private final WindowManager windowManager;
|
72
|
74
|
|
73
|
75
|
/**
|
74
|
76
|
* Creates a new instance of the join channel command.
|
|
@@ -79,8 +81,10 @@ public class JoinChannelCommand extends Command implements IntelligentCommand {
|
79
|
81
|
@Inject
|
80
|
82
|
public JoinChannelCommand(
|
81
|
83
|
final CommandController controller,
|
|
84
|
+ final WindowManager windowManager,
|
82
|
85
|
final DMDircMBassador eventBus) {
|
83
|
86
|
super(controller);
|
|
87
|
+ this.windowManager = windowManager;
|
84
|
88
|
eventBus.subscribe(this);
|
85
|
89
|
}
|
86
|
90
|
|
|
@@ -185,14 +189,14 @@ public class JoinChannelCommand extends Command implements IntelligentCommand {
|
185
|
189
|
}
|
186
|
190
|
|
187
|
191
|
// Check the parent window
|
188
|
|
- final Optional<WindowModel> parent = source.getParent();
|
|
192
|
+ final Optional<WindowModel> parent = windowManager.getParent(source);
|
189
|
193
|
if (checkParents && parent.isPresent()) {
|
190
|
194
|
results.addAll(checkSource(parent.get(), true, false));
|
191
|
195
|
}
|
192
|
196
|
|
193
|
197
|
// Check the children window
|
194
|
198
|
if (checkChildren) {
|
195
|
|
- for (WindowModel child : source.getChildren()) {
|
|
199
|
+ for (WindowModel child : windowManager.getChildren(source)) {
|
196
|
200
|
results.addAll(checkSource(child, false, true));
|
197
|
201
|
}
|
198
|
202
|
}
|