Selaa lähdekoodia

Replace Query with PrivateChat in Connection.

pull/704/head
Chris Smith 7 vuotta sitten
vanhempi
commit
28d2a13704

+ 5
- 4
src/main/java/com/dmdirc/Server.java Näytä tiedosto

@@ -33,6 +33,7 @@ import com.dmdirc.events.ServerUnknownProtocolEvent;
33 33
 import com.dmdirc.interfaces.Connection;
34 34
 import com.dmdirc.interfaces.GroupChatManager;
35 35
 import com.dmdirc.interfaces.InviteManager;
36
+import com.dmdirc.interfaces.PrivateChat;
36 37
 import com.dmdirc.interfaces.User;
37 38
 import com.dmdirc.interfaces.WindowModel;
38 39
 import com.dmdirc.interfaces.config.ConfigChangeListener;
@@ -441,12 +442,12 @@ public class Server implements Connection {
441 442
     }
442 443
 
443 444
     @Override
444
-    public Query getQuery(final String host) {
445
+    public PrivateChat getQuery(final String host) {
445 446
         return getQuery(host, false);
446 447
     }
447 448
 
448 449
     @Override
449
-    public Query getQuery(final String host, final boolean focus) {
450
+    public PrivateChat getQuery(final String host, final boolean focus) {
450 451
         synchronized (myStateLock) {
451 452
             if (myState.getState() == ServerState.CLOSING) {
452 453
                 // Can't open queries while the server is closing
@@ -490,12 +491,12 @@ public class Server implements Connection {
490 491
     }
491 492
 
492 493
     @Override
493
-    public Collection<Query> getQueries() {
494
+    public Collection<PrivateChat> getQueries() {
494 495
         return Collections.unmodifiableCollection(queries.values());
495 496
     }
496 497
 
497 498
     @Override
498
-    public void delQuery(final Query query) {
499
+    public void delQuery(final PrivateChat query) {
499 500
         windowModel.getInputModel().get().getTabCompleter().removeEntry(
500 501
                 TabCompletionType.QUERY_NICK, query.getNickname());
501 502
         queries.remove(converter.toLowerCase(query.getNickname()));

+ 6
- 4
src/main/java/com/dmdirc/commandparser/CommandManager.java Näytä tiedosto

@@ -23,7 +23,6 @@
23 23
 package com.dmdirc.commandparser;
24 24
 
25 25
 import com.dmdirc.GlobalWindow;
26
-import com.dmdirc.Query;
27 26
 import com.dmdirc.commandparser.commands.Command;
28 27
 import com.dmdirc.commandparser.parsers.CommandParser;
29 28
 import com.dmdirc.config.ConfigBinding;
@@ -31,6 +30,7 @@ import com.dmdirc.interfaces.CommandController;
31 30
 import com.dmdirc.interfaces.Connection;
32 31
 import com.dmdirc.interfaces.ConnectionManager;
33 32
 import com.dmdirc.interfaces.GroupChat;
33
+import com.dmdirc.interfaces.PrivateChat;
34 34
 import com.dmdirc.interfaces.config.AggregateConfigProvider;
35 35
 import com.dmdirc.ui.input.TabCompleter;
36 36
 import com.dmdirc.ui.input.TabCompletionType;
@@ -197,10 +197,12 @@ public class CommandManager implements CommandController {
197 197
 
198 198
             if (command.getType() == CommandType.TYPE_QUERY
199 199
                     || command.getType() == CommandType.TYPE_CHAT) {
200
-                for (Query query : server.getQueries()) {
201
-                    registerCommandName(query.getInputModel().get().getTabCompleter(),
200
+                for (PrivateChat query : server.getQueries()) {
201
+                    registerCommandName(
202
+                            query.getWindowModel().getInputModel().get().getTabCompleter(),
202 203
                             plainCommandName, register);
203
-                    registerCommandName(query.getInputModel().get().getTabCompleter(),
204
+                    registerCommandName(
205
+                            query.getWindowModel().getInputModel().get().getTabCompleter(),
204 206
                             silencedCommandName, register);
205 207
                 }
206 208
             }

+ 2
- 2
src/main/java/com/dmdirc/commandparser/commands/server/OpenQuery.java Näytä tiedosto

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.commandparser.commands.server;
24 24
 
25
-import com.dmdirc.Query;
26 25
 import com.dmdirc.commandparser.BaseCommandInfo;
27 26
 import com.dmdirc.commandparser.CommandArguments;
28 27
 import com.dmdirc.commandparser.CommandInfo;
@@ -35,6 +34,7 @@ import com.dmdirc.commandparser.commands.context.CommandContext;
35 34
 import com.dmdirc.commandparser.commands.context.ServerCommandContext;
36 35
 import com.dmdirc.interfaces.CommandController;
37 36
 import com.dmdirc.interfaces.Connection;
37
+import com.dmdirc.interfaces.PrivateChat;
38 38
 import com.dmdirc.interfaces.WindowModel;
39 39
 import com.dmdirc.ui.input.AdditionalTabTargets;
40 40
 import com.dmdirc.ui.input.TabCompletionType;
@@ -85,7 +85,7 @@ public class OpenQuery extends Command implements IntelligentCommand,
85 85
             return;
86 86
         }
87 87
 
88
-        final Query query = connection.getQuery(args.getArguments()[0], !args.isSilent());
88
+        final PrivateChat query = connection.getQuery(args.getArguments()[0], !args.isSilent());
89 89
 
90 90
         if (args.getArguments().length > 1) {
91 91
             query.sendLine(args.getArgumentsAsString(1), args.getArguments()[0]);

+ 4
- 5
src/main/java/com/dmdirc/interfaces/Connection.java Näytä tiedosto

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.interfaces;
24 24
 
25
-import com.dmdirc.Query;
26 25
 import com.dmdirc.ServerState;
27 26
 import com.dmdirc.ServerStatus;
28 27
 import com.dmdirc.config.profiles.Profile;
@@ -75,7 +74,7 @@ public interface Connection {
75 74
      *
76 75
      * @param query The query that should be removed.
77 76
      */
78
-    void delQuery(final Query query);
77
+    void delQuery(final PrivateChat query);
79 78
 
80 79
     /**
81 80
      * Disconnects from the server with the default quit message.
@@ -167,7 +166,7 @@ public interface Connection {
167 166
      *
168 167
      * @return list of queries belonging to this server
169 168
      */
170
-    Collection<Query> getQueries();
169
+    Collection<PrivateChat> getQueries();
171 170
 
172 171
     /**
173 172
      * Retrieves the specified query belonging to this server. If the query does not yet exist, it
@@ -177,7 +176,7 @@ public interface Connection {
177 176
      *
178 177
      * @return The appropriate query object
179 178
      */
180
-    Query getQuery(final String host);
179
+    PrivateChat getQuery(final String host);
181 180
 
182 181
     /**
183 182
      * Retrieves the specified query belonging to this server. If the query does not yet exist, it
@@ -188,7 +187,7 @@ public interface Connection {
188 187
      *
189 188
      * @return The appropriate query object
190 189
      */
191
-    Query getQuery(final String host, final boolean focus);
190
+    PrivateChat getQuery(final String host, final boolean focus);
192 191
 
193 192
     /**
194 193
      * Retrieves the identity for this server.

Loading…
Peruuta
Tallenna