Преглед изворни кода

Lots of changes.

tags/0.6.3m2a1
Chris Smith пре 15 година
родитељ
комит
d2eed5cbf8
65 измењених фајлова са 285 додато и 232 уклоњено
  1. 7
    8
      src/com/dmdirc/Channel.java
  2. 16
    16
      src/com/dmdirc/ChannelEventHandler.java
  3. 1
    2
      src/com/dmdirc/Invite.java
  4. 1
    1
      src/com/dmdirc/Query.java
  5. 3
    3
      src/com/dmdirc/Server.java
  6. 3
    3
      src/com/dmdirc/ServerEventHandler.java
  7. 2
    2
      src/com/dmdirc/actions/CoreActionComponent.java
  8. 1
    1
      src/com/dmdirc/actions/metatypes/ServerEvents.java
  9. 3
    3
      src/com/dmdirc/addons/dcc/DCCPlugin.java
  10. 8
    8
      src/com/dmdirc/addons/logging/LoggingPlugin.java
  11. 4
    4
      src/com/dmdirc/addons/nickcolours/NickColourPlugin.java
  12. 1
    1
      src/com/dmdirc/addons/userlevel/AccessLevelComponent.java
  13. 1
    1
      src/com/dmdirc/addons/userlevel/UserLevelPlugin.java
  14. 2
    2
      src/com/dmdirc/addons/windowstatus/WindowStatusPlugin.java
  15. 2
    2
      src/com/dmdirc/commandparser/commands/channel/ShowTopic.java
  16. 34
    0
      src/com/dmdirc/parser/interfaces/ClientInfo.java
  17. 19
    2
      src/com/dmdirc/parser/interfaces/Parser.java
  18. 2
    2
      src/com/dmdirc/parser/interfaces/callbacks/ChannelActionListener.java
  19. 2
    2
      src/com/dmdirc/parser/interfaces/callbacks/ChannelCtcpListener.java
  20. 2
    2
      src/com/dmdirc/parser/interfaces/callbacks/ChannelCtcpReplyListener.java
  21. 2
    2
      src/com/dmdirc/parser/interfaces/callbacks/ChannelJoinListener.java
  22. 2
    2
      src/com/dmdirc/parser/interfaces/callbacks/ChannelKickListener.java
  23. 2
    2
      src/com/dmdirc/parser/interfaces/callbacks/ChannelListModeListener.java
  24. 2
    2
      src/com/dmdirc/parser/interfaces/callbacks/ChannelMessageListener.java
  25. 2
    2
      src/com/dmdirc/parser/interfaces/callbacks/ChannelModeChangeListener.java
  26. 2
    2
      src/com/dmdirc/parser/interfaces/callbacks/ChannelModeMessageListener.java
  27. 2
    2
      src/com/dmdirc/parser/interfaces/callbacks/ChannelModeNoticeListener.java
  28. 2
    2
      src/com/dmdirc/parser/interfaces/callbacks/ChannelNamesListener.java
  29. 2
    2
      src/com/dmdirc/parser/interfaces/callbacks/ChannelNickChangeListener.java
  30. 2
    2
      src/com/dmdirc/parser/interfaces/callbacks/ChannelNonUserModeChangeListener.java
  31. 2
    2
      src/com/dmdirc/parser/interfaces/callbacks/ChannelNoticeListener.java
  32. 2
    2
      src/com/dmdirc/parser/interfaces/callbacks/ChannelOtherAwayStateListener.java
  33. 2
    2
      src/com/dmdirc/parser/interfaces/callbacks/ChannelPartListener.java
  34. 2
    2
      src/com/dmdirc/parser/interfaces/callbacks/ChannelQuitListener.java
  35. 2
    2
      src/com/dmdirc/parser/interfaces/callbacks/ChannelSelfJoinListener.java
  36. 2
    2
      src/com/dmdirc/parser/interfaces/callbacks/ChannelSingleModeChangeListener.java
  37. 2
    2
      src/com/dmdirc/parser/interfaces/callbacks/ChannelTopicListener.java
  38. 2
    2
      src/com/dmdirc/parser/interfaces/callbacks/ChannelUserModeChangeListener.java
  39. 1
    1
      src/com/dmdirc/parser/interfaces/callbacks/NickChangeListener.java
  40. 1
    1
      src/com/dmdirc/parser/interfaces/callbacks/OtherAwayStateListener.java
  41. 2
    1
      src/com/dmdirc/parser/interfaces/callbacks/QuitListener.java
  42. 1
    1
      src/com/dmdirc/parser/interfaces/callbacks/UserModeChangeListener.java
  43. 1
    1
      src/com/dmdirc/parser/interfaces/callbacks/UserModeDiscoveryListener.java
  44. 7
    4
      src/com/dmdirc/parser/irc/ChannelClientInfo.java
  45. 11
    10
      src/com/dmdirc/parser/irc/IRCChannelInfo.java
  46. 4
    3
      src/com/dmdirc/parser/irc/IRCClientInfo.java
  47. 18
    23
      src/com/dmdirc/parser/irc/IRCParser.java
  48. 1
    1
      src/com/dmdirc/parser/irc/IRCProcessor.java
  49. 9
    9
      src/com/dmdirc/parser/irc/Process001.java
  50. 2
    2
      src/com/dmdirc/parser/irc/Process004005.java
  51. 3
    3
      src/com/dmdirc/parser/irc/ProcessAway.java
  52. 3
    3
      src/com/dmdirc/parser/irc/ProcessJoin.java
  53. 4
    4
      src/com/dmdirc/parser/irc/ProcessKick.java
  54. 8
    8
      src/com/dmdirc/parser/irc/ProcessMessage.java
  55. 6
    8
      src/com/dmdirc/parser/irc/ProcessMode.java
  56. 3
    3
      src/com/dmdirc/parser/irc/ProcessNames.java
  57. 6
    5
      src/com/dmdirc/parser/irc/ProcessNick.java
  58. 4
    4
      src/com/dmdirc/parser/irc/ProcessPart.java
  59. 8
    6
      src/com/dmdirc/parser/irc/ProcessQuit.java
  60. 1
    1
      src/com/dmdirc/parser/irc/ProcessTopic.java
  61. 5
    3
      src/com/dmdirc/parser/irc/ProcessWho.java
  62. 6
    6
      src/com/dmdirc/parser/irc/callbacks/CallbackObjectSpecific.java
  63. 2
    2
      test/com/dmdirc/harness/parser/TestINickChanged.java
  64. 2
    2
      test/com/dmdirc/harness/parser/TestIQuit.java
  65. 16
    16
      test/com/dmdirc/parser/irc/ClientInfoTest.java

+ 7
- 8
src/com/dmdirc/Channel.java Прегледај датотеку

@@ -29,9 +29,8 @@ import com.dmdirc.commandparser.CommandType;
29 29
 import com.dmdirc.config.ConfigManager;
30 30
 import com.dmdirc.interfaces.ConfigChangeListener;
31 31
 import com.dmdirc.parser.interfaces.ChannelInfo;
32
+import com.dmdirc.parser.interfaces.ClientInfo;
32 33
 import com.dmdirc.parser.irc.ChannelClientInfo;
33
-import com.dmdirc.parser.irc.IRCChannelInfo;
34
-import com.dmdirc.parser.irc.ClientInfo;
35 34
 import com.dmdirc.ui.WindowManager;
36 35
 import com.dmdirc.ui.input.TabCompleter;
37 36
 import com.dmdirc.ui.input.TabCompletionType;
@@ -102,7 +101,7 @@ public class Channel extends MessageTarget implements ConfigChangeListener,
102 101
      * @param newChannelInfo The parser's channel object that corresponds to
103 102
      * this channel
104 103
      */
105
-    public Channel(final Server newServer, final IRCChannelInfo newChannelInfo) {
104
+    public Channel(final Server newServer, final ChannelInfo newChannelInfo) {
106 105
         super("channel", newChannelInfo.getName(),
107 106
                 new ConfigManager(newServer.getIrcd(), newServer.getNetwork(),
108 107
                 newServer.getName(), newChannelInfo.getName()));
@@ -165,7 +164,7 @@ public class Channel extends MessageTarget implements ConfigChangeListener,
165 164
             return;
166 165
         }
167 166
 
168
-        final ClientInfo me = server.getParser().getMyself();
167
+        final ClientInfo me = server.getParser().getLocalClient();
169 168
         final String[] details = getDetails(channelInfo.getUser(me), showColours);
170 169
 
171 170
         for (String part : splitLine(window.getTranscoder().encode(line))) {
@@ -200,7 +199,7 @@ public class Channel extends MessageTarget implements ConfigChangeListener,
200 199
             return;
201 200
         }
202 201
 
203
-        final ClientInfo me = server.getParser().getMyself();
202
+        final ClientInfo me = server.getParser().getLocalClient();
204 203
         final String[] details = getDetails(channelInfo.getUser(me), showColours);
205 204
 
206 205
         if (server.getParser().getMaxLength("PRIVMSG", getChannelInfo().getName())
@@ -246,7 +245,7 @@ public class Channel extends MessageTarget implements ConfigChangeListener,
246 245
      *
247 246
      * @param newChannelInfo The new ChannelInfo object
248 247
      */
249
-    public void setChannelInfo(final IRCChannelInfo newChannelInfo) {
248
+    public void setChannelInfo(final ChannelInfo newChannelInfo) {
250 249
         channelInfo = newChannelInfo;
251 250
         registerCallbacks();
252 251
     }
@@ -276,7 +275,7 @@ public class Channel extends MessageTarget implements ConfigChangeListener,
276 275
     public void selfJoin() {
277 276
         onChannel = true;
278 277
 
279
-        final ClientInfo me = server.getParser().getMyself();
278
+        final ClientInfo me = server.getParser().getLocalClient();
280 279
         addLine("channelSelfJoin", "", me.getNickname(), me.getIdent(),
281 280
                 me.getHost(), channelInfo.getName());
282 281
 
@@ -396,7 +395,7 @@ public class Channel extends MessageTarget implements ConfigChangeListener,
396 395
         window.removeName(client);
397 396
         tabCompleter.removeEntry(TabCompletionType.CHANNEL_NICK, client.getNickname());
398 397
 
399
-        if (client.getClient().equals(server.getParser().getMyself())) {
398
+        if (client.getClient().equals(server.getParser().getLocalClient())) {
400 399
             resetWindow();
401 400
         }
402 401
     }

+ 16
- 16
src/com/dmdirc/ChannelEventHandler.java Прегледај датотеку

@@ -24,10 +24,10 @@ package com.dmdirc;
24 24
 
25 25
 import com.dmdirc.actions.ActionManager;
26 26
 import com.dmdirc.actions.CoreActionType;
27
+import com.dmdirc.parser.interfaces.ChannelInfo;
28
+import com.dmdirc.parser.interfaces.ClientInfo;
27 29
 import com.dmdirc.parser.interfaces.Parser;
28 30
 import com.dmdirc.parser.irc.ChannelClientInfo;
29
-import com.dmdirc.parser.irc.IRCChannelInfo;
30
-import com.dmdirc.parser.irc.ClientInfo;
31 31
 import com.dmdirc.parser.irc.callbacks.CallbackManager;
32 32
 import com.dmdirc.parser.irc.callbacks.CallbackNotFoundException;
33 33
 import com.dmdirc.parser.interfaces.callbacks.*;
@@ -82,13 +82,13 @@ public final class ChannelEventHandler extends EventHandler implements
82 82
      * @return True if the client is ourself, false otherwise.
83 83
      */
84 84
     protected boolean isMyself(final ChannelClientInfo client) {
85
-        return client.getClient().equals(owner.getServer().getParser().getMyself());
85
+        return client.getClient().equals(owner.getServer().getParser().getLocalClient());
86 86
     }
87 87
 
88 88
     /** {@inheritDoc} */
89 89
     @Override
90 90
     public void onChannelMessage(final Parser tParser,
91
-            final IRCChannelInfo cChannel, final ChannelClientInfo cChannelClient,
91
+            final ChannelInfo cChannel, final ChannelClientInfo cChannelClient,
92 92
             final String sMessage, final String sHost) {
93 93
         checkParser(tParser);
94 94
 
@@ -99,7 +99,7 @@ public final class ChannelEventHandler extends EventHandler implements
99 99
 
100 100
     /** {@inheritDoc} */
101 101
     @Override
102
-    public void onChannelGotNames(final Parser tParser, final IRCChannelInfo cChannel) {
102
+    public void onChannelGotNames(final Parser tParser, final ChannelInfo cChannel) {
103 103
         checkParser(tParser);
104 104
 
105 105
         owner.setClients(cChannel.getChannelClients());
@@ -109,7 +109,7 @@ public final class ChannelEventHandler extends EventHandler implements
109 109
     /** {@inheritDoc} */
110 110
     @Override
111 111
     public void onChannelTopic(final Parser tParser,
112
-            final IRCChannelInfo cChannel, final boolean bIsJoinTopic) {
112
+            final ChannelInfo cChannel, final boolean bIsJoinTopic) {
113 113
         checkParser(tParser);
114 114
 
115 115
         final Topic newTopic = new Topic(cChannel.getTopic(),
@@ -128,7 +128,7 @@ public final class ChannelEventHandler extends EventHandler implements
128 128
 
129 129
     /** {@inheritDoc} */
130 130
     @Override
131
-    public void onChannelJoin(final Parser tParser, final IRCChannelInfo cChannel,
131
+    public void onChannelJoin(final Parser tParser, final ChannelInfo cChannel,
132 132
             final ChannelClientInfo cChannelClient) {
133 133
         checkParser(tParser);
134 134
 
@@ -138,7 +138,7 @@ public final class ChannelEventHandler extends EventHandler implements
138 138
 
139 139
     /** {@inheritDoc} */
140 140
     @Override
141
-    public void onChannelPart(final Parser tParser, final IRCChannelInfo cChannel,
141
+    public void onChannelPart(final Parser tParser, final ChannelInfo cChannel,
142 142
             final ChannelClientInfo cChannelClient, final String sReason) {
143 143
         checkParser(tParser);
144 144
 
@@ -151,7 +151,7 @@ public final class ChannelEventHandler extends EventHandler implements
151 151
 
152 152
     /** {@inheritDoc} */
153 153
     @Override
154
-    public void onChannelKick(final Parser tParser, final IRCChannelInfo cChannel,
154
+    public void onChannelKick(final Parser tParser, final ChannelInfo cChannel,
155 155
             final ChannelClientInfo cKickedClient, final ChannelClientInfo cKickedByClient,
156 156
             final String sReason, final String sKickedByHost) {
157 157
         checkParser(tParser);
@@ -163,7 +163,7 @@ public final class ChannelEventHandler extends EventHandler implements
163 163
 
164 164
     /** {@inheritDoc} */
165 165
     @Override
166
-    public void onChannelQuit(final Parser tParser, final IRCChannelInfo cChannel,
166
+    public void onChannelQuit(final Parser tParser, final ChannelInfo cChannel,
167 167
             final ChannelClientInfo cChannelClient, final String sReason) {
168 168
         checkParser(tParser);
169 169
 
@@ -174,7 +174,7 @@ public final class ChannelEventHandler extends EventHandler implements
174 174
 
175 175
     /** {@inheritDoc} */
176 176
     @Override
177
-    public void onChannelAction(final Parser tParser, final IRCChannelInfo cChannel,
177
+    public void onChannelAction(final Parser tParser, final ChannelInfo cChannel,
178 178
             final ChannelClientInfo cChannelClient, final String sMessage,
179 179
             final String sHost) {
180 180
         checkParser(tParser);
@@ -186,7 +186,7 @@ public final class ChannelEventHandler extends EventHandler implements
186 186
 
187 187
     /** {@inheritDoc} */
188 188
     @Override
189
-    public void onChannelNickChanged(final Parser tParser, final IRCChannelInfo cChannel,
189
+    public void onChannelNickChanged(final Parser tParser, final ChannelInfo cChannel,
190 190
             final ChannelClientInfo cChannelClient, final String sOldNick) {
191 191
         checkParser(tParser);
192 192
 
@@ -198,7 +198,7 @@ public final class ChannelEventHandler extends EventHandler implements
198 198
 
199 199
     /** {@inheritDoc} */
200 200
     @Override
201
-    public void onChannelModeChanged(final Parser tParser, final IRCChannelInfo cChannel,
201
+    public void onChannelModeChanged(final Parser tParser, final ChannelInfo cChannel,
202 202
             final ChannelClientInfo cChannelClient, final String sHost,
203 203
             final String sModes) {
204 204
         checkParser(tParser);
@@ -219,7 +219,7 @@ public final class ChannelEventHandler extends EventHandler implements
219 219
     /** {@inheritDoc} */
220 220
     @Override
221 221
     public void onChannelUserModeChanged(final Parser tParser,
222
-            final IRCChannelInfo cChannel, final ChannelClientInfo cChangedClient,
222
+            final ChannelInfo cChannel, final ChannelClientInfo cChangedClient,
223 223
             final ChannelClientInfo cSetByClient, final String sHost, final String sMode) {
224 224
         checkParser(tParser);
225 225
 
@@ -237,7 +237,7 @@ public final class ChannelEventHandler extends EventHandler implements
237 237
 
238 238
     /** {@inheritDoc} */
239 239
     @Override
240
-    public void onChannelCTCP(final Parser tParser, final IRCChannelInfo cChannel,
240
+    public void onChannelCTCP(final Parser tParser, final ChannelInfo cChannel,
241 241
             final ChannelClientInfo cChannelClient, final String sType,
242 242
             final String sMessage, final String sHost) {
243 243
         checkParser(tParser);
@@ -265,7 +265,7 @@ public final class ChannelEventHandler extends EventHandler implements
265 265
     /** {@inheritDoc} */
266 266
     @Override
267 267
     public void onChannelNotice(final Parser tParser,
268
-            final IRCChannelInfo cChannel, final ChannelClientInfo cChannelClient,
268
+            final ChannelInfo cChannel, final ChannelClientInfo cChannelClient,
269 269
             final String sMessage, final String sHost) {
270 270
         checkParser(tParser);
271 271
 

+ 1
- 2
src/com/dmdirc/Invite.java Прегледај датотеку

@@ -22,8 +22,7 @@
22 22
 
23 23
 package com.dmdirc;
24 24
 
25
-import com.dmdirc.parser.irc.ClientInfo;
26
-
25
+import com.dmdirc.parser.interfaces.ClientInfo;
27 26
 import java.util.Date;
28 27
 
29 28
 /**

+ 1
- 1
src/com/dmdirc/Query.java Прегледај датотеку

@@ -28,8 +28,8 @@ import com.dmdirc.commandparser.CommandManager;
28 28
 import com.dmdirc.commandparser.CommandType;
29 29
 import com.dmdirc.logger.ErrorLevel;
30 30
 import com.dmdirc.logger.Logger;
31
+import com.dmdirc.parser.interfaces.ClientInfo;
31 32
 import com.dmdirc.parser.interfaces.Parser;
32
-import com.dmdirc.parser.irc.ClientInfo;
33 33
 import com.dmdirc.parser.irc.callbacks.CallbackManager;
34 34
 import com.dmdirc.parser.irc.callbacks.CallbackNotFoundException;
35 35
 import com.dmdirc.parser.interfaces.callbacks.NickChangeListener;

+ 3
- 3
src/com/dmdirc/Server.java Прегледај датотеку

@@ -34,9 +34,9 @@ import com.dmdirc.interfaces.AwayStateListener;
34 34
 import com.dmdirc.interfaces.InviteListener;
35 35
 import com.dmdirc.logger.ErrorLevel;
36 36
 import com.dmdirc.logger.Logger;
37
+import com.dmdirc.parser.interfaces.ChannelInfo;
38
+import com.dmdirc.parser.interfaces.ClientInfo;
37 39
 import com.dmdirc.parser.interfaces.Parser;
38
-import com.dmdirc.parser.irc.IRCChannelInfo;
39
-import com.dmdirc.parser.irc.ClientInfo;
40 40
 import com.dmdirc.parser.irc.IRCStringConverter;
41 41
 import com.dmdirc.parser.irc.MyInfo;
42 42
 import com.dmdirc.parser.irc.ParserError;
@@ -566,7 +566,7 @@ public class Server extends WritableFrameContainer implements Serializable {
566 566
      *
567 567
      * @param chan channel to add
568 568
      */
569
-    public void addChannel(final IRCChannelInfo chan) {
569
+    public void addChannel(final ChannelInfo chan) {
570 570
         synchronized (myState) {
571 571
             if (myState.getState() == ServerState.CLOSING) {
572 572
                 // Can't join channels while the server is closing

+ 3
- 3
src/com/dmdirc/ServerEventHandler.java Прегледај датотеку

@@ -26,9 +26,9 @@ import com.dmdirc.actions.ActionManager;
26 26
 import com.dmdirc.actions.CoreActionType;
27 27
 import com.dmdirc.logger.ErrorLevel;
28 28
 import com.dmdirc.logger.Logger;
29
+import com.dmdirc.parser.interfaces.ChannelInfo;
30
+import com.dmdirc.parser.interfaces.ClientInfo;
29 31
 import com.dmdirc.parser.interfaces.Parser;
30
-import com.dmdirc.parser.irc.IRCChannelInfo;
31
-import com.dmdirc.parser.irc.ClientInfo;
32 32
 import com.dmdirc.parser.irc.ParserError;
33 33
 import com.dmdirc.parser.irc.callbacks.CallbackManager;
34 34
 import com.dmdirc.parser.irc.callbacks.CallbackNotFoundException;
@@ -78,7 +78,7 @@ public final class ServerEventHandler extends EventHandler
78 78
 
79 79
     /** {@inheritDoc} */
80 80
     @Override
81
-    public void onChannelSelfJoin(final Parser tParser, final IRCChannelInfo cChannel) {
81
+    public void onChannelSelfJoin(final Parser tParser, final ChannelInfo cChannel) {
82 82
         checkParser(tParser);
83 83
         owner.addChannel(cChannel);
84 84
     }

+ 2
- 2
src/com/dmdirc/actions/CoreActionComponent.java Прегледај датотеку

@@ -30,8 +30,8 @@ import com.dmdirc.Server;
30 30
 import com.dmdirc.config.Identity;
31 31
 import com.dmdirc.logger.ErrorLevel;
32 32
 import com.dmdirc.logger.Logger;
33
+import com.dmdirc.parser.interfaces.ClientInfo;
33 34
 import com.dmdirc.parser.irc.ChannelClientInfo;
34
-import com.dmdirc.parser.irc.ClientInfo;
35 35
 import com.dmdirc.ui.messages.Styliser;
36 36
 
37 37
 import java.awt.Color;
@@ -128,7 +128,7 @@ public enum CoreActionComponent implements ActionComponent {
128 128
                 
129 129
                 return "null";
130 130
             } else {
131
-                return server.getParser().getMyself().getNickname();
131
+                return server.getParser().getLocalClient().getNickname();
132 132
             }
133 133
         }
134 134
         /** {@inheritDoc} */

+ 1
- 1
src/com/dmdirc/actions/metatypes/ServerEvents.java Прегледај датотеку

@@ -24,7 +24,7 @@ package com.dmdirc.actions.metatypes;
24 24
 
25 25
 import com.dmdirc.Server;
26 26
 import com.dmdirc.actions.interfaces.ActionMetaType;
27
-import com.dmdirc.parser.irc.ClientInfo;
27
+import com.dmdirc.parser.interfaces.ClientInfo;
28 28
 
29 29
 /**
30 30
  * Defines server-related events.

+ 3
- 3
src/com/dmdirc/addons/dcc/DCCPlugin.java Прегледај датотеку

@@ -41,8 +41,8 @@ import com.dmdirc.config.prefs.PreferencesType;
41 41
 import com.dmdirc.interfaces.ActionListener;
42 42
 import com.dmdirc.logger.ErrorLevel;
43 43
 import com.dmdirc.logger.Logger;
44
+import com.dmdirc.parser.interfaces.ClientInfo;
44 45
 import com.dmdirc.parser.interfaces.Parser;
45
-import com.dmdirc.parser.irc.ClientInfo;
46 46
 import com.dmdirc.plugins.Plugin;
47 47
 import com.dmdirc.ui.WindowManager;
48 48
 
@@ -372,7 +372,7 @@ public final class DCCPlugin extends Plugin implements ActionListener {
372 372
 								if ((!token.isEmpty() && !send.getToken().isEmpty()) && (!token.equals(send.getToken()))) {
373 373
 									continue;
374 374
 								}
375
-								final IRCParser parser = ((Server)arguments[0]).getParser();
375
+								final Parser parser = ((Server)arguments[0]).getParser();
376 376
 								final String nickname = ((ClientInfo)arguments[1]).getNickname();
377 377
 								if (ctcpData[0].equalsIgnoreCase("resume")) {
378 378
 									parser.sendCTCP(nickname, "DCC", "ACCEPT "+((quoted) ? "\""+filename+"\"" : filename)+" "+port+" "+send.setFileStart(position)+token);
@@ -516,7 +516,7 @@ public final class DCCPlugin extends Plugin implements ActionListener {
516 516
 		if (!configIP.isEmpty()) {
517 517
 			return configIP;
518 518
 		} else if (parser != null) {
519
-			final String myHost = parser.getMyself().getHost();
519
+			final String myHost = parser.getLocalClient().getHost();
520 520
 			if (!myHost.isEmpty()) {
521 521
 				try {
522 522
 					return InetAddress.getByName(myHost).getHostAddress();

+ 8
- 8
src/com/dmdirc/addons/logging/LoggingPlugin.java Прегледај датотеку

@@ -38,10 +38,10 @@ import com.dmdirc.config.prefs.PreferencesType;
38 38
 import com.dmdirc.interfaces.ActionListener;
39 39
 import com.dmdirc.logger.ErrorLevel;
40 40
 import com.dmdirc.logger.Logger;
41
+import com.dmdirc.parser.interfaces.ChannelInfo;
42
+import com.dmdirc.parser.interfaces.ClientInfo;
41 43
 import com.dmdirc.parser.interfaces.Parser;
42 44
 import com.dmdirc.parser.irc.ChannelClientInfo;
43
-import com.dmdirc.parser.irc.IRCChannelInfo;
44
-import com.dmdirc.parser.irc.ClientInfo;
45 45
 import com.dmdirc.plugins.Plugin;
46 46
 import com.dmdirc.ui.interfaces.InputWindow;
47 47
 import com.dmdirc.ui.interfaces.Window;
@@ -246,7 +246,7 @@ public class LoggingPlugin extends Plugin implements ActionListener {
246 246
 			return;
247 247
 		}
248 248
 		
249
-		final IRCParser parser = query.getServer().getParser();
249
+		final Parser parser = query.getServer().getParser();
250 250
 		ClientInfo client;
251 251
 		
252 252
 		if (parser == null) {
@@ -259,7 +259,7 @@ public class LoggingPlugin extends Plugin implements ActionListener {
259 259
 		} else {
260 260
 			client = parser.getClientInfo(query.getHost());
261 261
 			if (client == null) {
262
-				client = new ClientInfo(parser, query.getHost()).setFake(true);
262
+				client = new IRCClientInfo(parser, query.getHost()).setFake(true);
263 263
 			}
264 264
 		}
265 265
 		
@@ -312,7 +312,7 @@ public class LoggingPlugin extends Plugin implements ActionListener {
312 312
 	 */
313 313
 	protected void handleChannelEvent(final CoreActionType type, final StringBuffer format, final Object... arguments) {
314 314
 		final Channel chan = ((Channel)arguments[0]);
315
-		final IRCChannelInfo channel = chan.getChannelInfo();
315
+		final ChannelInfo channel = chan.getChannelInfo();
316 316
 		final String filename = getLogFile(channel);
317 317
 		
318 318
 		final ChannelClientInfo channelClient = (arguments.length > 1 && arguments[1] instanceof ChannelClientInfo) ? (ChannelClientInfo)arguments[1] : null;
@@ -608,8 +608,8 @@ public class LoggingPlugin extends Plugin implements ActionListener {
608 608
 		
609 609
 		if (obj == null) {
610 610
 			file.append("null.log");
611
-		} else if (obj instanceof IRCChannelInfo) {
612
-			final IRCChannelInfo channel = (IRCChannelInfo) obj;
611
+		} else if (obj instanceof ChannelInfo) {
612
+			final ChannelInfo channel = (ChannelInfo) obj;
613 613
 			if (channel.getParser() != null) {
614 614
 				addNetworkDir(directory, file, channel.getParser().getNetworkName());
615 615
 			}
@@ -783,7 +783,7 @@ public class LoggingPlugin extends Plugin implements ActionListener {
783 783
 			final Parser parser = ((Query) target.getContainer()).getServer().getParser();
784 784
 			component = parser.getClientInfo(((Query) target.getContainer()).getHost());
785 785
 			if (component == null) {
786
-				component = new ClientInfo(parser, ((Query) target.getContainer()).getHost()).setFake(true);
786
+				component = new IRCClientInfo(parser, ((Query) target.getContainer()).getHost()).setFake(true);
787 787
 			}
788 788
 		} else if (target.getContainer() instanceof Server) {
789 789
 			component = target.getContainer().getServer().getParser();

+ 4
- 4
src/com/dmdirc/addons/nickcolours/NickColourPlugin.java Прегледај датотеку

@@ -33,9 +33,9 @@ import com.dmdirc.config.prefs.PreferencesManager;
33 33
 import com.dmdirc.config.prefs.PreferencesSetting;
34 34
 import com.dmdirc.config.prefs.PreferencesType;
35 35
 import com.dmdirc.interfaces.ActionListener;
36
+import com.dmdirc.parser.interfaces.ChannelInfo;
37
+import com.dmdirc.parser.interfaces.ClientInfo;
36 38
 import com.dmdirc.parser.irc.ChannelClientInfo;
37
-import com.dmdirc.parser.irc.IRCChannelInfo;
38
-import com.dmdirc.parser.irc.ClientInfo;
39 39
 import com.dmdirc.plugins.Plugin;
40 40
 import com.dmdirc.ui.messages.ColourManager;
41 41
 
@@ -67,7 +67,7 @@ public final class NickColourPlugin extends Plugin implements ActionListener {
67 67
     public void processEvent(final ActionType type, final StringBuffer format,
68 68
             final Object... arguments) {
69 69
         if (type.equals(CoreActionType.CHANNEL_GOTNAMES)) {
70
-            final IRCChannelInfo chanInfo = ((Channel) arguments[0]).getChannelInfo();
70
+            final ChannelInfo chanInfo = ((Channel) arguments[0]).getChannelInfo();
71 71
             final String network = ((Channel) arguments[0]).getServer().getNetwork();
72 72
             
73 73
             for (ChannelClientInfo client : chanInfo.getChannelClients()) {
@@ -88,7 +88,7 @@ public final class NickColourPlugin extends Plugin implements ActionListener {
88 88
      */
89 89
     private void colourClient(final String network, final ChannelClientInfo client) {
90 90
         final Map map = client.getMap();
91
-        final ClientInfo myself = client.getClient().getParser().getMyself();
91
+        final ClientInfo myself = client.getClient().getParser().getLocalClient();
92 92
         final String nickOption1 = "color:"
93 93
                 + client.getClient().getParser().getIRCStringConverter().toLowerCase(network + ":" + client.getNickname());
94 94
         final String nickOption2 = "color:"

+ 1
- 1
src/com/dmdirc/addons/userlevel/AccessLevelComponent.java Прегледај датотеку

@@ -23,7 +23,7 @@
23 23
 package com.dmdirc.addons.userlevel;
24 24
 
25 25
 import com.dmdirc.actions.interfaces.ActionComponent;
26
-import com.dmdirc.parser.irc.ClientInfo;
26
+import com.dmdirc.parser.interfaces.ClientInfo;
27 27
 
28 28
 /**
29 29
  * Action component to retrieve a client's global access level.

+ 1
- 1
src/com/dmdirc/addons/userlevel/UserLevelPlugin.java Прегледај датотеку

@@ -29,8 +29,8 @@ import com.dmdirc.actions.interfaces.ActionType;
29 29
 import com.dmdirc.config.IdentityManager;
30 30
 import com.dmdirc.interfaces.ActionListener;
31 31
 import com.dmdirc.interfaces.ConfigChangeListener;
32
+import com.dmdirc.parser.interfaces.ClientInfo;
32 33
 import com.dmdirc.parser.irc.ChannelClientInfo;
33
-import com.dmdirc.parser.irc.ClientInfo;
34 34
 import com.dmdirc.plugins.Plugin;
35 35
 
36 36
 import java.util.HashMap;

+ 2
- 2
src/com/dmdirc/addons/windowstatus/WindowStatusPlugin.java Прегледај датотеку

@@ -40,7 +40,7 @@ import com.dmdirc.interfaces.ActionListener;
40 40
 import com.dmdirc.interfaces.ConfigChangeListener;
41 41
 import com.dmdirc.parser.irc.ChannelClientInfo;
42 42
 import com.dmdirc.parser.irc.IRCChannelInfo;
43
-import com.dmdirc.parser.irc.ClientInfo;
43
+import com.dmdirc.parser.irc.IRCClientInfo;
44 44
 import com.dmdirc.plugins.Plugin;
45 45
 import com.dmdirc.ui.interfaces.InputWindow;
46 46
 import com.dmdirc.ui.interfaces.Window;
@@ -176,7 +176,7 @@ public final class WindowStatusPlugin extends Plugin implements ActionListener,
176 176
 
177 177
 			textString.append(frame.getHost());
178 178
 			if (IdentityManager.getGlobalConfig().getOptionBool(getDomain(), "client.showname") && frame.getServer().getParser() != null) {
179
-				final ClientInfo client = frame.getServer().getParser().getClientInfo(frame.getHost());
179
+				final IRCClientInfo client = frame.getServer().getParser().getClientInfo(frame.getHost());
180 180
 				if (client != null) {
181 181
 					final String realname = client.getRealName();
182 182
 					if (!realname.isEmpty()) {

+ 2
- 2
src/com/dmdirc/commandparser/commands/channel/ShowTopic.java Прегледај датотеку

@@ -29,7 +29,7 @@ import com.dmdirc.commandparser.commands.ChannelCommand;
29 29
 import com.dmdirc.commandparser.CommandManager;
30 30
 import com.dmdirc.commandparser.commands.ExternalCommand;
31 31
 import com.dmdirc.parser.irc.IRCChannelInfo;
32
-import com.dmdirc.parser.irc.ClientInfo;
32
+import com.dmdirc.parser.irc.IRCClientInfo;
33 33
 import com.dmdirc.ui.interfaces.InputWindow;
34 34
 
35 35
 /**
@@ -55,7 +55,7 @@ public final class ShowTopic extends ChannelCommand implements ExternalCommand {
55 55
             if (cChannel.getTopic().isEmpty()) {
56 56
                 sendLine(origin, isSilent, "channelNoTopic", cChannel);
57 57
             } else {
58
-                final String[] parts = ClientInfo.parseHostFull(cChannel.getTopicUser());
58
+                final String[] parts = IRCClientInfo.parseHostFull(cChannel.getTopicUser());
59 59
 
60 60
                 sendLine(origin, isSilent, "channelTopicDiscovered",
61 61
                         "", parts[0], parts[1], parts[2], cChannel.getTopic(),

+ 34
- 0
src/com/dmdirc/parser/interfaces/ClientInfo.java Прегледај датотеку

@@ -0,0 +1,34 @@
1
+/*
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package com.dmdirc.parser.interfaces;
24
+
25
+/**
26
+ * Holds information about a client, and provides various methods for
27
+ * interacting with that client.
28
+ *
29
+ * @author chris
30
+ * @since 0.6.3m2
31
+ */
32
+public interface ClientInfo {
33
+
34
+}

+ 19
- 2
src/com/dmdirc/parser/interfaces/Parser.java Прегледај датотеку

@@ -22,6 +22,8 @@
22 22
 
23 23
 package com.dmdirc.parser.interfaces;
24 24
 
25
+import java.util.Collection;
26
+
25 27
 /**
26 28
  * A parser connects to a back-end chat system and handles all communication
27 29
  * with it.
@@ -63,9 +65,16 @@ public interface Parser extends Runnable {
63 65
     ChannelInfo getChannel(String channel);
64 66
 
65 67
     /**
66
-     * Set the current Value of bindIP.
68
+     * Retrieves a collection of all known channels.
69
+     *
70
+     * @return A collection of known channels
71
+     */
72
+    Collection<ChannelInfo> getChannels();
73
+
74
+    /**
75
+     * Set the IP address that this parser will bind to
67 76
      *
68
-     * @param ip New value to set bindIP
77
+     * @param ip IP to bind to
69 78
      */
70 79
     void setBindIP(String ip);
71 80
 
@@ -78,4 +87,12 @@ public interface Parser extends Runnable {
78 87
      */
79 88
     int getMaxLength(final String type, final String target);
80 89
 
90
+    /**
91
+     * Returns a {@link ClientInfo} object which represents the locally
92
+     * connected client.
93
+     *
94
+     * @return An info object for the local client
95
+     */
96
+    ClientInfo getLocalClient();
97
+
81 98
 }

+ 2
- 2
src/com/dmdirc/parser/interfaces/callbacks/ChannelActionListener.java Прегледај датотеку

@@ -22,9 +22,9 @@
22 22
 
23 23
 package com.dmdirc.parser.interfaces.callbacks;
24 24
 
25
+import com.dmdirc.parser.interfaces.ChannelInfo;
25 26
 import com.dmdirc.parser.interfaces.Parser;
26 27
 import com.dmdirc.parser.irc.ChannelClientInfo;
27
-import com.dmdirc.parser.irc.IRCChannelInfo;
28 28
 import com.dmdirc.parser.irc.callbacks.FakableArgument;
29 29
 import com.dmdirc.parser.irc.callbacks.FakableSource;
30 30
 import com.dmdirc.parser.irc.callbacks.SpecificCallback;
@@ -51,7 +51,7 @@ public interface ChannelActionListener extends CallbackInterface {
51 51
 	 */
52 52
 	void onChannelAction(
53 53
             @FakableSource Parser tParser,
54
-            @FakableSource IRCChannelInfo cChannel,
54
+            @FakableSource ChannelInfo cChannel,
55 55
             @FakableArgument ChannelClientInfo cChannelClient,
56 56
             String sMessage,
57 57
             @FakableSource String sHost);

+ 2
- 2
src/com/dmdirc/parser/interfaces/callbacks/ChannelCtcpListener.java Прегледај датотеку

@@ -22,9 +22,9 @@
22 22
 
23 23
 package com.dmdirc.parser.interfaces.callbacks;
24 24
 
25
+import com.dmdirc.parser.interfaces.ChannelInfo;
25 26
 import com.dmdirc.parser.interfaces.Parser;
26 27
 import com.dmdirc.parser.irc.ChannelClientInfo;
27
-import com.dmdirc.parser.irc.IRCChannelInfo;
28 28
 import com.dmdirc.parser.irc.callbacks.FakableArgument;
29 29
 import com.dmdirc.parser.irc.callbacks.FakableSource;
30 30
 import com.dmdirc.parser.irc.callbacks.SpecificCallback;
@@ -50,7 +50,7 @@ public interface ChannelCtcpListener extends CallbackInterface {
50 50
 	 * @see com.dmdirc.parser.irc.ProcessMessage#callChannelCTCP
51 51
 	 */
52 52
 	void onChannelCTCP(@FakableSource Parser tParser,
53
-            @FakableSource IRCChannelInfo cChannel,
53
+            @FakableSource ChannelInfo cChannel,
54 54
             @FakableArgument ChannelClientInfo cChannelClient,
55 55
             String sType, String sMessage,
56 56
             @FakableSource String sHost);

+ 2
- 2
src/com/dmdirc/parser/interfaces/callbacks/ChannelCtcpReplyListener.java Прегледај датотеку

@@ -22,9 +22,9 @@
22 22
 
23 23
 package com.dmdirc.parser.interfaces.callbacks;
24 24
 
25
+import com.dmdirc.parser.interfaces.ChannelInfo;
25 26
 import com.dmdirc.parser.interfaces.Parser;
26 27
 import com.dmdirc.parser.irc.ChannelClientInfo;
27
-import com.dmdirc.parser.irc.IRCChannelInfo;
28 28
 import com.dmdirc.parser.irc.callbacks.FakableArgument;
29 29
 import com.dmdirc.parser.irc.callbacks.FakableSource;
30 30
 import com.dmdirc.parser.irc.callbacks.SpecificCallback;
@@ -50,7 +50,7 @@ public interface ChannelCtcpReplyListener extends CallbackInterface {
50 50
 	 * @see com.dmdirc.parser.irc.ProcessMessage#callChannelCTCPReply
51 51
 	 */
52 52
 	void onChannelCTCPReply(@FakableSource Parser tParser,
53
-            @FakableSource IRCChannelInfo cChannel,
53
+            @FakableSource ChannelInfo cChannel,
54 54
             @FakableArgument ChannelClientInfo cChannelClient,
55 55
             String sType, String sMessage,
56 56
             @FakableSource String sHost);

+ 2
- 2
src/com/dmdirc/parser/interfaces/callbacks/ChannelJoinListener.java Прегледај датотеку

@@ -22,9 +22,9 @@
22 22
 
23 23
 package com.dmdirc.parser.interfaces.callbacks;
24 24
 
25
+import com.dmdirc.parser.interfaces.ChannelInfo;
25 26
 import com.dmdirc.parser.interfaces.Parser;
26 27
 import com.dmdirc.parser.irc.ChannelClientInfo;
27
-import com.dmdirc.parser.irc.IRCChannelInfo;
28 28
 import com.dmdirc.parser.irc.callbacks.SpecificCallback;
29 29
 
30 30
 /** 
@@ -42,5 +42,5 @@ public interface ChannelJoinListener extends CallbackInterface {
42 42
 	 * @param cChannelClient ChannelClient object for new person
43 43
 	 * @see com.dmdirc.parser.irc.ProcessJoin#callChannelJoin
44 44
 	 */
45
-	void onChannelJoin(Parser tParser, IRCChannelInfo cChannel, ChannelClientInfo cChannelClient);
45
+	void onChannelJoin(Parser tParser, ChannelInfo cChannel, ChannelClientInfo cChannelClient);
46 46
 }

+ 2
- 2
src/com/dmdirc/parser/interfaces/callbacks/ChannelKickListener.java Прегледај датотеку

@@ -22,9 +22,9 @@
22 22
 
23 23
 package com.dmdirc.parser.interfaces.callbacks;
24 24
 
25
+import com.dmdirc.parser.interfaces.ChannelInfo;
25 26
 import com.dmdirc.parser.interfaces.Parser;
26 27
 import com.dmdirc.parser.irc.ChannelClientInfo;
27
-import com.dmdirc.parser.irc.IRCChannelInfo;
28 28
 import com.dmdirc.parser.irc.callbacks.FakableArgument;
29 29
 import com.dmdirc.parser.irc.callbacks.FakableSource;
30 30
 import com.dmdirc.parser.irc.callbacks.SpecificCallback;
@@ -48,7 +48,7 @@ public interface ChannelKickListener extends CallbackInterface {
48 48
 	 * @see com.dmdirc.parser.irc.ProcessKick#callChannelKick
49 49
 	 */
50 50
 	void onChannelKick(@FakableSource Parser tParser,
51
-            @FakableSource IRCChannelInfo cChannel,
51
+            @FakableSource ChannelInfo cChannel,
52 52
             ChannelClientInfo cKickedClient,
53 53
             @FakableArgument ChannelClientInfo cKickedByClient,
54 54
             String sReason,

+ 2
- 2
src/com/dmdirc/parser/interfaces/callbacks/ChannelListModeListener.java Прегледај датотеку

@@ -22,8 +22,8 @@
22 22
 
23 23
 package com.dmdirc.parser.interfaces.callbacks;
24 24
 
25
+import com.dmdirc.parser.interfaces.ChannelInfo;
25 26
 import com.dmdirc.parser.interfaces.Parser;
26
-import com.dmdirc.parser.irc.IRCChannelInfo;
27 27
 import com.dmdirc.parser.irc.callbacks.SpecificCallback;
28 28
 
29 29
 /**
@@ -40,5 +40,5 @@ public interface ChannelListModeListener extends CallbackInterface {
40 40
 	 * @param cChannel Channel which the ListModes reply is for
41 41
 	 * @see com.dmdirc.parser.irc.ProcessListModes#callChannelGotListModes
42 42
 	 */
43
-	void onChannelGotListModes(Parser tParser, IRCChannelInfo cChannel);
43
+	void onChannelGotListModes(Parser tParser, ChannelInfo cChannel);
44 44
 }

+ 2
- 2
src/com/dmdirc/parser/interfaces/callbacks/ChannelMessageListener.java Прегледај датотеку

@@ -22,9 +22,9 @@
22 22
 
23 23
 package com.dmdirc.parser.interfaces.callbacks;
24 24
 
25
+import com.dmdirc.parser.interfaces.ChannelInfo;
25 26
 import com.dmdirc.parser.interfaces.Parser;
26 27
 import com.dmdirc.parser.irc.ChannelClientInfo;
27
-import com.dmdirc.parser.irc.IRCChannelInfo;
28 28
 import com.dmdirc.parser.irc.callbacks.FakableArgument;
29 29
 import com.dmdirc.parser.irc.callbacks.FakableSource;
30 30
 import com.dmdirc.parser.irc.callbacks.SpecificCallback;
@@ -49,7 +49,7 @@ public interface ChannelMessageListener extends CallbackInterface {
49 49
 	 * @see com.dmdirc.parser.irc.ProcessMessage#callChannelMessage
50 50
 	 */
51 51
 	void onChannelMessage(@FakableSource Parser tParser,
52
-            @FakableSource IRCChannelInfo cChannel,
52
+            @FakableSource ChannelInfo cChannel,
53 53
             @FakableArgument ChannelClientInfo cChannelClient,
54 54
             String sMessage,
55 55
             @FakableSource String sHost);

+ 2
- 2
src/com/dmdirc/parser/interfaces/callbacks/ChannelModeChangeListener.java Прегледај датотеку

@@ -22,9 +22,9 @@
22 22
 
23 23
 package com.dmdirc.parser.interfaces.callbacks;
24 24
 
25
+import com.dmdirc.parser.interfaces.ChannelInfo;
25 26
 import com.dmdirc.parser.interfaces.Parser;
26 27
 import com.dmdirc.parser.irc.ChannelClientInfo;
27
-import com.dmdirc.parser.irc.IRCChannelInfo;
28 28
 import com.dmdirc.parser.irc.callbacks.FakableArgument;
29 29
 import com.dmdirc.parser.irc.callbacks.FakableSource;
30 30
 import com.dmdirc.parser.irc.callbacks.SpecificCallback;
@@ -49,7 +49,7 @@ public interface ChannelModeChangeListener extends CallbackInterface {
49 49
 	 * @see com.dmdirc.parser.irc.ProcessMode#callChannelModeChanged
50 50
 	 */
51 51
 	void onChannelModeChanged(@FakableSource Parser tParser,
52
-            @FakableSource IRCChannelInfo cChannel,
52
+            @FakableSource ChannelInfo cChannel,
53 53
             @FakableArgument ChannelClientInfo cChannelClient,
54 54
             @FakableSource String sHost,
55 55
             String sModes);

+ 2
- 2
src/com/dmdirc/parser/interfaces/callbacks/ChannelModeMessageListener.java Прегледај датотеку

@@ -22,9 +22,9 @@
22 22
 
23 23
 package com.dmdirc.parser.interfaces.callbacks;
24 24
 
25
+import com.dmdirc.parser.interfaces.ChannelInfo;
25 26
 import com.dmdirc.parser.interfaces.Parser;
26 27
 import com.dmdirc.parser.irc.ChannelClientInfo;
27
-import com.dmdirc.parser.irc.IRCChannelInfo;
28 28
 import com.dmdirc.parser.irc.callbacks.FakableArgument;
29 29
 import com.dmdirc.parser.irc.callbacks.FakableSource;
30 30
 import com.dmdirc.parser.irc.callbacks.SpecificCallback;
@@ -51,7 +51,7 @@ public interface ChannelModeMessageListener extends CallbackInterface {
51 51
 	 */
52 52
 	void onChannelModeMessage(@FakableSource Parser tParser,
53 53
             char prefix,
54
-            @FakableSource IRCChannelInfo cChannel,
54
+            @FakableSource ChannelInfo cChannel,
55 55
             @FakableArgument ChannelClientInfo cChannelClient,
56 56
             String sMessage,
57 57
             @FakableSource String sHost);

+ 2
- 2
src/com/dmdirc/parser/interfaces/callbacks/ChannelModeNoticeListener.java Прегледај датотеку

@@ -22,9 +22,9 @@
22 22
 
23 23
 package com.dmdirc.parser.interfaces.callbacks;
24 24
 
25
+import com.dmdirc.parser.interfaces.ChannelInfo;
25 26
 import com.dmdirc.parser.interfaces.Parser;
26 27
 import com.dmdirc.parser.irc.ChannelClientInfo;
27
-import com.dmdirc.parser.irc.IRCChannelInfo;
28 28
 import com.dmdirc.parser.irc.callbacks.FakableArgument;
29 29
 import com.dmdirc.parser.irc.callbacks.FakableSource;
30 30
 import com.dmdirc.parser.irc.callbacks.SpecificCallback;
@@ -51,7 +51,7 @@ public interface ChannelModeNoticeListener extends CallbackInterface {
51 51
 	 */
52 52
 	void onChannelModeNotice(@FakableSource Parser tParser,
53 53
             char prefix,
54
-            @FakableSource IRCChannelInfo cChannel,
54
+            @FakableSource ChannelInfo cChannel,
55 55
             @FakableArgument ChannelClientInfo cChannelClient,
56 56
             String sMessage,
57 57
             @FakableSource String sHost);

+ 2
- 2
src/com/dmdirc/parser/interfaces/callbacks/ChannelNamesListener.java Прегледај датотеку

@@ -22,8 +22,8 @@
22 22
 
23 23
 package com.dmdirc.parser.interfaces.callbacks;
24 24
 
25
+import com.dmdirc.parser.interfaces.ChannelInfo;
25 26
 import com.dmdirc.parser.interfaces.Parser;
26
-import com.dmdirc.parser.irc.IRCChannelInfo;
27 27
 import com.dmdirc.parser.irc.callbacks.SpecificCallback;
28 28
 
29 29
 /**
@@ -38,5 +38,5 @@ public interface ChannelNamesListener extends CallbackInterface {
38 38
 	 * @param cChannel Channel which the names reply is for
39 39
 	 * @see com.dmdirc.parser.irc.ProcessNames#callChannelGotNames
40 40
 	 */
41
-	void onChannelGotNames(Parser tParser, IRCChannelInfo cChannel);
41
+	void onChannelGotNames(Parser tParser, ChannelInfo cChannel);
42 42
 }

+ 2
- 2
src/com/dmdirc/parser/interfaces/callbacks/ChannelNickChangeListener.java Прегледај датотеку

@@ -22,9 +22,9 @@
22 22
 
23 23
 package com.dmdirc.parser.interfaces.callbacks;
24 24
 
25
+import com.dmdirc.parser.interfaces.ChannelInfo;
25 26
 import com.dmdirc.parser.interfaces.Parser;
26 27
 import com.dmdirc.parser.irc.ChannelClientInfo;
27
-import com.dmdirc.parser.irc.IRCChannelInfo;
28 28
 import com.dmdirc.parser.irc.callbacks.SpecificCallback;
29 29
 
30 30
 /** 
@@ -43,5 +43,5 @@ public interface ChannelNickChangeListener extends CallbackInterface {
43 43
 	 * @param sOldNick Nickname before change
44 44
 	 * @see com.dmdirc.parser.irc.ProcessNick#callChannelNickChanged
45 45
 	 */
46
-	 void onChannelNickChanged(Parser tParser, IRCChannelInfo cChannel, ChannelClientInfo cChannelClient, String sOldNick);
46
+	 void onChannelNickChanged(Parser tParser, ChannelInfo cChannel, ChannelClientInfo cChannelClient, String sOldNick);
47 47
 }

+ 2
- 2
src/com/dmdirc/parser/interfaces/callbacks/ChannelNonUserModeChangeListener.java Прегледај датотеку

@@ -22,9 +22,9 @@
22 22
 
23 23
 package com.dmdirc.parser.interfaces.callbacks;
24 24
 
25
+import com.dmdirc.parser.interfaces.ChannelInfo;
25 26
 import com.dmdirc.parser.interfaces.Parser;
26 27
 import com.dmdirc.parser.irc.ChannelClientInfo;
27
-import com.dmdirc.parser.irc.IRCChannelInfo;
28 28
 import com.dmdirc.parser.irc.callbacks.FakableArgument;
29 29
 import com.dmdirc.parser.irc.callbacks.FakableSource;
30 30
 import com.dmdirc.parser.irc.callbacks.SpecificCallback;
@@ -48,7 +48,7 @@ public interface ChannelNonUserModeChangeListener extends CallbackInterface {
48 48
 	 * @param sModes String showing the exact mode change parsed. (Not including user modes)
49 49
 	 */
50 50
 	void onChannelNonUserModeChanged(@FakableSource Parser tParser,
51
-            @FakableSource IRCChannelInfo cChannel,
51
+            @FakableSource ChannelInfo cChannel,
52 52
             @FakableArgument ChannelClientInfo cChannelClient,
53 53
             @FakableSource String sHost,
54 54
             String sModes);

+ 2
- 2
src/com/dmdirc/parser/interfaces/callbacks/ChannelNoticeListener.java Прегледај датотеку

@@ -22,9 +22,9 @@
22 22
 
23 23
 package com.dmdirc.parser.interfaces.callbacks;
24 24
 
25
+import com.dmdirc.parser.interfaces.ChannelInfo;
25 26
 import com.dmdirc.parser.interfaces.Parser;
26 27
 import com.dmdirc.parser.irc.ChannelClientInfo;
27
-import com.dmdirc.parser.irc.IRCChannelInfo;
28 28
 import com.dmdirc.parser.irc.callbacks.FakableArgument;
29 29
 import com.dmdirc.parser.irc.callbacks.FakableSource;
30 30
 import com.dmdirc.parser.irc.callbacks.SpecificCallback;
@@ -49,7 +49,7 @@ public interface ChannelNoticeListener extends CallbackInterface {
49 49
 	 * @see com.dmdirc.parser.irc.ProcessMessage#callChannelNotice
50 50
 	 */
51 51
 	void onChannelNotice(@FakableSource Parser tParser,
52
-            @FakableSource IRCChannelInfo cChannel,
52
+            @FakableSource ChannelInfo cChannel,
53 53
             @FakableArgument ChannelClientInfo cChannelClient,
54 54
             String sMessage,
55 55
             @FakableSource String sHost);

+ 2
- 2
src/com/dmdirc/parser/interfaces/callbacks/ChannelOtherAwayStateListener.java Прегледај датотеку

@@ -22,9 +22,9 @@
22 22
 
23 23
 package com.dmdirc.parser.interfaces.callbacks;
24 24
 
25
+import com.dmdirc.parser.interfaces.ChannelInfo;
25 26
 import com.dmdirc.parser.interfaces.Parser;
26 27
 import com.dmdirc.parser.irc.ChannelClientInfo;
27
-import com.dmdirc.parser.irc.IRCChannelInfo;
28 28
 import com.dmdirc.parser.irc.callbacks.SpecificCallback;
29 29
 
30 30
 /**
@@ -41,5 +41,5 @@ public interface ChannelOtherAwayStateListener extends CallbackInterface {
41 41
 	 * @param state Away State (true if away, false if here)
42 42
 	 * @see com.dmdirc.parser.irc.ProcessAway#callChannelAwayStateOther
43 43
 	 */
44
-	void onChannelAwayStateOther(Parser tParser, IRCChannelInfo channel, ChannelClientInfo channelClient, boolean state);
44
+	void onChannelAwayStateOther(Parser tParser, ChannelInfo channel, ChannelClientInfo channelClient, boolean state);
45 45
 }

+ 2
- 2
src/com/dmdirc/parser/interfaces/callbacks/ChannelPartListener.java Прегледај датотеку

@@ -22,9 +22,9 @@
22 22
 
23 23
 package com.dmdirc.parser.interfaces.callbacks;
24 24
 
25
+import com.dmdirc.parser.interfaces.ChannelInfo;
25 26
 import com.dmdirc.parser.interfaces.Parser;
26 27
 import com.dmdirc.parser.irc.ChannelClientInfo;
27
-import com.dmdirc.parser.irc.IRCChannelInfo;
28 28
 import com.dmdirc.parser.irc.callbacks.SpecificCallback;
29 29
 
30 30
 /** 
@@ -43,5 +43,5 @@ public interface ChannelPartListener extends CallbackInterface {
43 43
 	 * @param sReason Reason given for parting (May be "")
44 44
 	 * @see com.dmdirc.parser.irc.ProcessPart#callChannelPart
45 45
 	 */
46
-	void onChannelPart(Parser tParser, IRCChannelInfo cChannel, ChannelClientInfo cChannelClient, String sReason);
46
+	void onChannelPart(Parser tParser, ChannelInfo cChannel, ChannelClientInfo cChannelClient, String sReason);
47 47
 }

+ 2
- 2
src/com/dmdirc/parser/interfaces/callbacks/ChannelQuitListener.java Прегледај датотеку

@@ -22,9 +22,9 @@
22 22
 
23 23
 package com.dmdirc.parser.interfaces.callbacks;
24 24
 
25
+import com.dmdirc.parser.interfaces.ChannelInfo;
25 26
 import com.dmdirc.parser.interfaces.Parser;
26 27
 import com.dmdirc.parser.irc.ChannelClientInfo;
27
-import com.dmdirc.parser.irc.IRCChannelInfo;
28 28
 import com.dmdirc.parser.irc.callbacks.SpecificCallback;
29 29
 
30 30
 /** 
@@ -43,5 +43,5 @@ public interface ChannelQuitListener extends CallbackInterface {
43 43
 	 * @param sReason Quit reason
44 44
 	 * @see com.dmdirc.parser.irc.ProcessQuit#callChannelQuit
45 45
 	 */
46
-	void onChannelQuit(Parser tParser, IRCChannelInfo cChannel, ChannelClientInfo cChannelClient, String sReason);
46
+	void onChannelQuit(Parser tParser, ChannelInfo cChannel, ChannelClientInfo cChannelClient, String sReason);
47 47
 }

+ 2
- 2
src/com/dmdirc/parser/interfaces/callbacks/ChannelSelfJoinListener.java Прегледај датотеку

@@ -22,8 +22,8 @@
22 22
 
23 23
 package com.dmdirc.parser.interfaces.callbacks;
24 24
 
25
+import com.dmdirc.parser.interfaces.ChannelInfo;
25 26
 import com.dmdirc.parser.interfaces.Parser;
26
-import com.dmdirc.parser.irc.IRCChannelInfo;
27 27
 
28 28
 /** 
29 29
  * Called When we join a channel.
@@ -38,5 +38,5 @@ public interface ChannelSelfJoinListener extends CallbackInterface {
38 38
 	 * @param cChannel Channel Object
39 39
 	 * @see com.dmdirc.parser.irc.ProcessJoin#callChannelSelfJoin
40 40
 	 */
41
-	void onChannelSelfJoin(Parser tParser, IRCChannelInfo cChannel);
41
+	void onChannelSelfJoin(Parser tParser, ChannelInfo cChannel);
42 42
 }

+ 2
- 2
src/com/dmdirc/parser/interfaces/callbacks/ChannelSingleModeChangeListener.java Прегледај датотеку

@@ -22,9 +22,9 @@
22 22
 
23 23
 package com.dmdirc.parser.interfaces.callbacks;
24 24
 
25
+import com.dmdirc.parser.interfaces.ChannelInfo;
25 26
 import com.dmdirc.parser.interfaces.Parser;
26 27
 import com.dmdirc.parser.irc.ChannelClientInfo;
27
-import com.dmdirc.parser.irc.IRCChannelInfo;
28 28
 import com.dmdirc.parser.irc.callbacks.FakableArgument;
29 29
 import com.dmdirc.parser.irc.callbacks.FakableSource;
30 30
 import com.dmdirc.parser.irc.callbacks.SpecificCallback;
@@ -48,7 +48,7 @@ public interface ChannelSingleModeChangeListener extends CallbackInterface {
48 48
 	 * @param sModes String parsed (ie "+m" or "+k moo"
49 49
 	 */
50 50
 	void onChannelSingleModeChanged(@FakableSource Parser tParser,
51
-            @FakableSource IRCChannelInfo cChannel,
51
+            @FakableSource ChannelInfo cChannel,
52 52
             @FakableArgument ChannelClientInfo cChannelClient,
53 53
             @FakableSource String sHost,
54 54
             String sModes);

+ 2
- 2
src/com/dmdirc/parser/interfaces/callbacks/ChannelTopicListener.java Прегледај датотеку

@@ -22,8 +22,8 @@
22 22
 
23 23
 package com.dmdirc.parser.interfaces.callbacks;
24 24
 
25
+import com.dmdirc.parser.interfaces.ChannelInfo;
25 26
 import com.dmdirc.parser.interfaces.Parser;
26
-import com.dmdirc.parser.irc.IRCChannelInfo;
27 27
 import com.dmdirc.parser.irc.callbacks.SpecificCallback;
28 28
 
29 29
 /** 
@@ -41,5 +41,5 @@ public interface ChannelTopicListener extends CallbackInterface {
41 41
 	 * @param bIsJoinTopic True when getting topic on join, false if set by user/server
42 42
 	 * @see com.dmdirc.parser.irc.ProcessTopic#callChannelTopic
43 43
 	 */
44
-	void onChannelTopic(Parser tParser, IRCChannelInfo cChannel, boolean bIsJoinTopic);
44
+	void onChannelTopic(Parser tParser, ChannelInfo cChannel, boolean bIsJoinTopic);
45 45
 }

+ 2
- 2
src/com/dmdirc/parser/interfaces/callbacks/ChannelUserModeChangeListener.java Прегледај датотеку

@@ -22,9 +22,9 @@
22 22
 
23 23
 package com.dmdirc.parser.interfaces.callbacks;
24 24
 
25
+import com.dmdirc.parser.interfaces.ChannelInfo;
25 26
 import com.dmdirc.parser.interfaces.Parser;
26 27
 import com.dmdirc.parser.irc.ChannelClientInfo;
27
-import com.dmdirc.parser.irc.IRCChannelInfo;
28 28
 import com.dmdirc.parser.irc.callbacks.FakableArgument;
29 29
 import com.dmdirc.parser.irc.callbacks.FakableSource;
30 30
 import com.dmdirc.parser.irc.callbacks.SpecificCallback;
@@ -48,7 +48,7 @@ public interface ChannelUserModeChangeListener extends CallbackInterface {
48 48
 	 * @see com.dmdirc.parser.irc.ProcessMode#callChannelUserModeChanged
49 49
 	 */
50 50
 	void onChannelUserModeChanged(@FakableSource Parser tParser,
51
-            @FakableSource IRCChannelInfo cChannel,
51
+            @FakableSource ChannelInfo cChannel,
52 52
             ChannelClientInfo cChangedClient,
53 53
             @FakableArgument ChannelClientInfo cSetByClient,
54 54
             @FakableSource String sHost,

+ 1
- 1
src/com/dmdirc/parser/interfaces/callbacks/NickChangeListener.java Прегледај датотеку

@@ -22,8 +22,8 @@
22 22
 
23 23
 package com.dmdirc.parser.interfaces.callbacks;
24 24
 
25
+import com.dmdirc.parser.interfaces.ClientInfo;
25 26
 import com.dmdirc.parser.interfaces.Parser;
26
-import com.dmdirc.parser.irc.ClientInfo;
27 27
 
28 28
 /**
29 29
  * Called when we or another user change nickname.

+ 1
- 1
src/com/dmdirc/parser/interfaces/callbacks/OtherAwayStateListener.java Прегледај датотеку

@@ -22,8 +22,8 @@
22 22
 
23 23
 package com.dmdirc.parser.interfaces.callbacks;
24 24
 
25
+import com.dmdirc.parser.interfaces.ClientInfo;
25 26
 import com.dmdirc.parser.interfaces.Parser;
26
-import com.dmdirc.parser.irc.ClientInfo;
27 27
 import com.dmdirc.parser.irc.callbacks.SpecificCallback;
28 28
 
29 29
 /**

+ 2
- 1
src/com/dmdirc/parser/interfaces/callbacks/QuitListener.java Прегледај датотеку

@@ -22,8 +22,9 @@
22 22
 
23 23
 package com.dmdirc.parser.interfaces.callbacks;
24 24
 
25
+import com.dmdirc.parser.interfaces.ClientInfo;
25 26
 import com.dmdirc.parser.interfaces.Parser;
26
-import com.dmdirc.parser.irc.ClientInfo;
27
+
27 28
 /** 
28 29
  * Called When we, or another client quits IRC (Called once in total).
29 30
  * This is called BEFORE client has been removed from the channel.

+ 1
- 1
src/com/dmdirc/parser/interfaces/callbacks/UserModeChangeListener.java Прегледај датотеку

@@ -22,8 +22,8 @@
22 22
 
23 23
 package com.dmdirc.parser.interfaces.callbacks;
24 24
 
25
+import com.dmdirc.parser.interfaces.ClientInfo;
25 26
 import com.dmdirc.parser.interfaces.Parser;
26
-import com.dmdirc.parser.irc.ClientInfo;
27 27
 
28 28
 /** 
29 29
  * Called when user modes are changed.

+ 1
- 1
src/com/dmdirc/parser/interfaces/callbacks/UserModeDiscoveryListener.java Прегледај датотеку

@@ -22,8 +22,8 @@
22 22
 
23 23
 package com.dmdirc.parser.interfaces.callbacks;
24 24
 
25
+import com.dmdirc.parser.interfaces.ClientInfo;
25 26
 import com.dmdirc.parser.interfaces.Parser;
26
-import com.dmdirc.parser.irc.ClientInfo;
27 27
 
28 28
 /** 
29 29
  * Called when user modes are Discovered.

+ 7
- 4
src/com/dmdirc/parser/irc/ChannelClientInfo.java Прегледај датотеку

@@ -22,6 +22,9 @@
22 22
 
23 23
 package com.dmdirc.parser.irc;
24 24
 
25
+import com.dmdirc.parser.interfaces.ChannelInfo;
26
+import com.dmdirc.parser.interfaces.ClientInfo;
27
+import com.dmdirc.parser.interfaces.Parser;
25 28
 import java.util.HashMap;
26 29
 import java.util.Map;
27 30
 
@@ -38,9 +41,9 @@ public class ChannelClientInfo {
38 41
 	/** Integer representation of the channel modes assocated with this user. */
39 42
 	private long nModes;
40 43
 	/** Reference to the parser object that owns this channelclient, Used for modes. */
41
-	private final IRCParser myParser;
44
+	private final Parser myParser;
42 45
 	/** Reference to the channel object that owns this channelclient. */
43
-	private final IRCChannelInfo myChannel;
46
+	private final ChannelInfo myChannel;
44 47
 	/** A Map to allow applications to attach misc data to this object */
45 48
 	private Map myMap;
46 49
 	
@@ -51,7 +54,7 @@ public class ChannelClientInfo {
51 54
 	 * @param client Client that this channelclient represents
52 55
 	 * @param channel Channel that owns this channelclient
53 56
 	 */	
54
-	public ChannelClientInfo(final IRCParser tParser, final ClientInfo client, final IRCChannelInfo channel) {
57
+	public ChannelClientInfo(final Parser tParser, final ClientInfo client, final ChannelInfo channel) {
55 58
 		myMap = new HashMap<Object, Object>();
56 59
 		myParser = tParser;
57 60
 		cClient = client;
@@ -90,7 +93,7 @@ public class ChannelClientInfo {
90 93
 	 *
91 94
 	 * @return Channel object that owns this ChannelClient
92 95
 	 */
93
-	public IRCChannelInfo getChannel() { return myChannel; }
96
+	public ChannelInfo getChannel() { return myChannel; }
94 97
 	/**
95 98
 	 * Get the nickname of the client object represented by this channelclient.
96 99
 	 *

+ 11
- 10
src/com/dmdirc/parser/irc/IRCChannelInfo.java Прегледај датотеку

@@ -23,6 +23,7 @@
23 23
 package com.dmdirc.parser.irc;
24 24
 
25 25
 import com.dmdirc.parser.interfaces.ChannelInfo;
26
+import com.dmdirc.parser.interfaces.ClientInfo;
26 27
 import java.util.ArrayList;
27 28
 import java.util.Hashtable;
28 29
 import java.util.HashMap;
@@ -38,7 +39,7 @@ import java.util.Queue;
38 39
  * @author Chris Smith
39 40
  * @see IRCParser
40 41
  */
41
-public class IRCChannelInfo implements ChannelInfo {
42
+class IRCChannelInfo implements ChannelInfo {
42 43
 	/**
43 44
 	 * Boolean repreenting the status of names requests.
44 45
 	 * When this is false, any new names reply will cause current known channelclients to be removed.
@@ -122,7 +123,7 @@ public class IRCChannelInfo implements ChannelInfo {
122 123
 	 * Ask the server for all the list modes for this channel.
123 124
 	 */
124 125
 	public void requestListModes() {
125
-		final ChannelClientInfo me = getUser(myParser.getMyself());
126
+		final ChannelClientInfo me = getUser(myParser.getLocalClient());
126 127
 		if (me == null) {
127 128
 			// In a normal situation of non bouncer-brokenness this won't happen
128 129
 			return;
@@ -268,11 +269,11 @@ public class IRCChannelInfo implements ChannelInfo {
268 269
 	 * Empty the channel (Remove all known channelclients).
269 270
 	 */
270 271
 	protected void emptyChannel() {
271
-		ClientInfo cTemp = null;
272
+		IRCClientInfo cTemp = null;
272 273
 		for (ChannelClientInfo client : hChannelUserList.values()) {
273 274
 			cTemp = client.getClient();
274 275
 			cTemp.delChannelClientInfo(client);
275
-			if (cTemp != myParser.getMyself() && !cTemp.checkVisibility()) {
276
+			if (cTemp != myParser.getLocalClient() && !cTemp.checkVisibility()) {
276 277
 				myParser.removeClient(cTemp);
277 278
 			}
278 279
 		}
@@ -298,12 +299,12 @@ public class IRCChannelInfo implements ChannelInfo {
298 299
 	 * @since 0.6
299 300
 	 */
300 301
 	public ChannelClientInfo getUser(final String sWho, final boolean createFake) {
301
-		final String who = myParser.getIRCStringConverter().toLowerCase(ClientInfo.parseHost(sWho));
302
+		final String who = myParser.getIRCStringConverter().toLowerCase(IRCClientInfo.parseHost(sWho));
302 303
 		if (hChannelUserList.containsKey(who)) {
303 304
 			return hChannelUserList.get(who);
304 305
 		}
305 306
 		if (createFake) {
306
-			return new ChannelClientInfo(myParser, (new ClientInfo(myParser, sWho)).setFake(true), this);
307
+			return new ChannelClientInfo(myParser, (new IRCClientInfo(myParser, sWho)).setFake(true), this);
307 308
 		} else {
308 309
 			return null;
309 310
 		}
@@ -330,7 +331,7 @@ public class IRCChannelInfo implements ChannelInfo {
330 331
 	 * @param cClient Client object to be added to channel
331 332
 	 * @return ChannelClientInfo object added, or an existing object if already known on channel
332 333
 	 */
333
-	protected ChannelClientInfo addClient(final ClientInfo cClient) {
334
+	protected ChannelClientInfo addClient(final IRCClientInfo cClient) {
334 335
 		ChannelClientInfo cTemp = getUser(cClient);
335 336
 		if (cTemp == null) { 
336 337
 			cTemp = new ChannelClientInfo(myParser, cClient, this);
@@ -344,13 +345,13 @@ public class IRCChannelInfo implements ChannelInfo {
344 345
 	 *
345 346
 	 * @param cClient Client object to be removed from channel
346 347
 	 */	
347
-	protected void delClient(final ClientInfo cClient) {
348
+	protected void delClient(final IRCClientInfo cClient) {
348 349
 		ChannelClientInfo cTemp = null;
349 350
 		cTemp = getUser(cClient);
350 351
 		if (cTemp != null) {
351
-			final ClientInfo clTemp = cTemp.getClient();
352
+			final IRCClientInfo clTemp = cTemp.getClient();
352 353
 			clTemp.delChannelClientInfo(cTemp);
353
-			if (clTemp != myParser.getMyself() && !clTemp.checkVisibility()) {
354
+			if (clTemp != myParser.getLocalClient() && !clTemp.checkVisibility()) {
354 355
 				myParser.removeClient(clTemp);
355 356
 			}
356 357
 			hChannelUserList.remove(myParser.getIRCStringConverter().toLowerCase(cTemp.getNickname()));

src/com/dmdirc/parser/irc/ClientInfo.java → src/com/dmdirc/parser/irc/IRCClientInfo.java Прегледај датотеку

@@ -22,6 +22,7 @@
22 22
 
23 23
 package com.dmdirc.parser.irc;
24 24
 
25
+import com.dmdirc.parser.interfaces.ClientInfo;
25 26
 import java.util.ArrayList;
26 27
 import java.util.List;
27 28
 import java.util.LinkedList;
@@ -36,7 +37,7 @@ import java.util.Map;
36 37
  * @author Chris Smith
37 38
  * @see IRCParser
38 39
  */
39
-public final class ClientInfo {
40
+class IRCClientInfo implements ClientInfo {
40 41
 	/** Known nickname of client. */
41 42
 	private String sNickname = "";
42 43
 	/** Known ident of client. */
@@ -69,7 +70,7 @@ public final class ClientInfo {
69 70
 	 * @param sHostmask Hostmask parsed by parseHost to get nickname
70 71
 	 * @see ClientInfo#parseHost
71 72
 	 */
72
-	public ClientInfo(final IRCParser tParser, final String sHostmask) { 
73
+	public IRCClientInfo(final IRCParser tParser, final String sHostmask) {
73 74
 		myMap = new HashMap<Object, Object>();
74 75
 		setUserBits(sHostmask, true);
75 76
 		myParser = tParser;
@@ -112,7 +113,7 @@ public final class ClientInfo {
112 113
 	 * @param newValue new value for isFake - True if this is a fake client, else false
113 114
 	 * @return this Object
114 115
 	 */
115
-	public ClientInfo setFake(final boolean newValue) { bIsFake = newValue; return this; }
116
+	public IRCClientInfo setFake(final boolean newValue) { bIsFake = newValue; return this; }
116 117
 
117 118
 	/**
118 119
 	 * Get a nickname of a user from a hostmask.

+ 18
- 23
src/com/dmdirc/parser/irc/IRCParser.java Прегледај датотеку

@@ -23,6 +23,7 @@
23 23
 package com.dmdirc.parser.irc;
24 24
 
25 25
 import com.dmdirc.parser.interfaces.ChannelInfo;
26
+import com.dmdirc.parser.interfaces.ClientInfo;
26 27
 import com.dmdirc.parser.interfaces.Parser;
27 28
 import com.dmdirc.parser.interfaces.callbacks.ConnectErrorListener;
28 29
 import com.dmdirc.parser.interfaces.callbacks.DataInListener;
@@ -207,9 +208,9 @@ class IRCParser implements Parser, Runnable {
207 208
 	/** Hashtable storing all known clients based on nickname (in lowercase). */
208 209
 	private final Map<String, ClientInfo> hClientList = new Hashtable<String, ClientInfo>();
209 210
 	/** Hashtable storing all known channels based on chanel name (inc prefix - in lowercase). */
210
-	private final Map<String, IRCChannelInfo> hChannelList = new Hashtable<String, IRCChannelInfo>();
211
+	private final Map<String, ChannelInfo> hChannelList = new Hashtable<String, ChannelInfo>();
211 212
 	/** Reference to the ClientInfo object that references ourself. */
212
-	private ClientInfo cMyself = new ClientInfo(this, "myself").setFake(true);
213
+	private IRCClientInfo cMyself = new IRCClientInfo(this, "myself").setFake(true);
213 214
 	/** Hashtable storing all information gathered from 005. */
214 215
 	final Map<String, String> h005Info = new Hashtable<String, String>();
215 216
 
@@ -596,7 +597,7 @@ class IRCParser implements Parser, Runnable {
596 597
 		sServerName = "";
597 598
 		sNetworkName = "";
598 599
 		lastLine = "";
599
-		cMyself = new ClientInfo(this, "myself").setFake(true);
600
+		cMyself = new IRCClientInfo(this, "myself").setFake(true);
600 601
 
601 602
 		stopPingTimer();
602 603
 
@@ -879,7 +880,7 @@ class IRCParser implements Parser, Runnable {
879 880
 	 * @return ClientInfo Object for the client, or null
880 881
 	 */
881 882
 	public ClientInfo getClientInfo(final String sHost) {
882
-		final String sWho = getIRCStringConverter().toLowerCase(ClientInfo.parseHost(sHost));
883
+		final String sWho = getIRCStringConverter().toLowerCase(IRCClientInfo.parseHost(sHost));
883 884
 		if (hClientList.containsKey(sWho)) { return hClientList.get(sWho); }
884 885
 		else { return null; }
885 886
 	}
@@ -891,9 +892,9 @@ class IRCParser implements Parser, Runnable {
891 892
 	 * @return ClientInfo Object for the client.
892 893
 	 */
893 894
 	public ClientInfo getClientInfoOrFake(final String sHost) {
894
-		final String sWho = getIRCStringConverter().toLowerCase(ClientInfo.parseHost(sHost));
895
+		final String sWho = getIRCStringConverter().toLowerCase(IRCClientInfo.parseHost(sHost));
895 896
 		if (hClientList.containsKey(sWho)) { return hClientList.get(sWho); }
896
-		else { return new ClientInfo(this, sHost).setFake(true); }
897
+		else { return new IRCClientInfo(this, sHost).setFake(true); }
897 898
 	}
898 899
 
899 900
 	/** {@inheritDoc} */
@@ -1981,12 +1982,9 @@ class IRCParser implements Parser, Runnable {
1981 1982
 		return pingNeeded.get();
1982 1983
 	}
1983 1984
 
1984
-	/**
1985
-	 * Get a reference to the cMyself object.
1986
-	 *
1987
-	 * @return cMyself reference
1988
-	 */
1989
-	public ClientInfo getMyself() { return cMyself; }
1985
+	/** {@inheritDoc} */
1986
+        @Override
1987
+	public ClientInfo getLocalClient() { return cMyself; }
1990 1988
 
1991 1989
 	/**
1992 1990
 	 * Get the current nickname.
@@ -2028,7 +2026,7 @@ class IRCParser implements Parser, Runnable {
2028 2026
 	 *
2029 2027
 	 * @param client Client to remove
2030 2028
 	 */
2031
-	public void removeClient(final ClientInfo client) {
2029
+	public void removeClient(final IRCClientInfo client) {
2032 2030
 		if (client != cMyself) {
2033 2031
 			forceRemoveClient(client);
2034 2032
 		}
@@ -2040,7 +2038,7 @@ class IRCParser implements Parser, Runnable {
2040 2038
 	 *
2041 2039
 	 * @param client Client to remove
2042 2040
 	 */
2043
-	protected void forceRemoveClient(final ClientInfo client) {
2041
+	protected void forceRemoveClient(final IRCClientInfo client) {
2044 2042
 		hClientList.remove(getIRCStringConverter().toLowerCase(client.getNickname()));
2045 2043
 	}
2046 2044
 
@@ -2067,7 +2065,7 @@ class IRCParser implements Parser, Runnable {
2067 2065
 	 */
2068 2066
 	public void clearClients() {
2069 2067
 		hClientList.clear();
2070
-		addClient(getMyself());
2068
+		addClient(getLocalClient());
2071 2069
 	}
2072 2070
 
2073 2071
 	/**
@@ -2086,7 +2084,7 @@ class IRCParser implements Parser, Runnable {
2086 2084
 	 *
2087 2085
 	 * @param channel Channel to remove
2088 2086
 	 */
2089
-	public void removeChannel(final IRCChannelInfo channel) {
2087
+	public void removeChannel(final ChannelInfo channel) {
2090 2088
 		synchronized (hChannelList) {
2091 2089
 			hChannelList.remove(getIRCStringConverter().toLowerCase(channel.getName()));
2092 2090
 		}
@@ -2103,14 +2101,11 @@ class IRCParser implements Parser, Runnable {
2103 2101
 		}
2104 2102
 	}
2105 2103
 
2106
-	/**
2107
-	 * Get the known channels as a collection.
2108
-	 *
2109
-	 * @return Known channels as a collection
2110
-	 */
2111
-	public Collection<IRCChannelInfo> getChannels() {
2104
+	/** {@inheritDoc} */
2105
+        @Override
2106
+	public Collection<ChannelInfo> getChannels() {
2112 2107
 		synchronized (hChannelList) {
2113
-			return hChannelList.values();
2108
+                    return hChannelList.values();
2114 2109
 		}
2115 2110
 	}
2116 2111
 

+ 1
- 1
src/com/dmdirc/parser/irc/IRCProcessor.java Прегледај датотеку

@@ -103,7 +103,7 @@ public abstract class IRCProcessor {
103 103
 	 * @param sWho Who can be any valid identifier for a client as long as it contains a nickname (?:)nick(?!ident)(?@host)
104 104
 	 * @return ClientInfo Object for the client, or null
105 105
 	 */
106
-	protected final ClientInfo getClientInfo(final String sWho) {
106
+	protected final IRCClientInfo getClientInfo(final String sWho) {
107 107
 		return myParser.getClientInfo(sWho);
108 108
 	}
109 109
 	

+ 9
- 9
src/com/dmdirc/parser/irc/Process001.java Прегледај датотеку

@@ -42,22 +42,22 @@ public class Process001 extends IRCProcessor {
42 42
 		final String sNick = token[2];
43 43
 				
44 44
 		// myself will be fake if we havn't recieved a 001 yet
45
-		if (myParser.getMyself().isFake()) {
45
+		if (myParser.getLocalClient().isFake()) {
46 46
 			// Update stored information
47
-			myParser.getMyself().setUserBits(sNick, true, true);
48
-			myParser.getMyself().setFake(false);
49
-			myParser.addClient(myParser.getMyself());
47
+			myParser.getLocalClient().setUserBits(sNick, true, true);
48
+			myParser.getLocalClient().setFake(false);
49
+			myParser.addClient(myParser.getLocalClient());
50 50
 		} else {
51 51
 			// Another 001? if nicknames change then we need to update the hashtable
52
-			if (!myParser.getMyself().getNickname().equalsIgnoreCase(sNick)) {
52
+			if (!myParser.getLocalClient().getNickname().equalsIgnoreCase(sNick)) {
53 53
 				// Nick changed, remove old me
54
-				myParser.forceRemoveClient(myParser.getMyself());
54
+				myParser.forceRemoveClient(myParser.getLocalClient());
55 55
 				/// Update stored information
56
-				myParser.getMyself().setUserBits(sNick, true, true);
56
+				myParser.getLocalClient().setUserBits(sNick, true, true);
57 57
 				// Check that we don't already know someone by this name
58
-				if (myParser.getClientInfo(myParser.getMyself().getNickname()) == null) {
58
+				if (myParser.getClientInfo(myParser.getLocalClient().getNickname()) == null) {
59 59
 					// And add to list
60
-					myParser.addClient(myParser.getMyself());
60
+					myParser.addClient(myParser.getLocalClient());
61 61
 				} else {
62 62
 					// Someone else already know? this is bad!
63 63
 					myParser.callErrorInfo(new ParserError(ParserError.ERROR_FATAL, "001 overwrites existing client?", myParser.getLastLine()));

+ 2
- 2
src/com/dmdirc/parser/irc/Process004005.java Прегледај датотеку

@@ -84,8 +84,8 @@ public class Process004005 extends IRCProcessor {
84 84
 						// This means that the casemapping is not rfc1459
85 85
 						// We have only added ourselves so far (from 001)
86 86
 						// We can fix the hashtable easily.
87
-						myParser.removeClient(myParser.getMyself());
88
-						myParser.addClient(myParser.getMyself());
87
+						myParser.removeClient(myParser.getLocalClient());
88
+						myParser.addClient(myParser.getLocalClient());
89 89
 					}
90 90
 				} else if (sKey.equals("CHANTYPES")) {
91 91
 					myParser.parseChanPrefix();

+ 3
- 3
src/com/dmdirc/parser/irc/ProcessAway.java Прегледај датотеку

@@ -37,11 +37,11 @@ public class ProcessAway extends IRCProcessor {
37 37
 	@Override
38 38
 	public void process(String sParam, String[] token) {
39 39
 		if (sParam.equals("301")) {
40
-			ClientInfo iClient = myParser.getClientInfo(token[3]);
40
+			IRCClientInfo iClient = myParser.getClientInfo(token[3]);
41 41
 			if (iClient != null) { iClient.setAwayReason(token[token.length-1]); }
42 42
 		} else {
43
-			myParser.getMyself().setAwayState(sParam.equals("306"));
44
-			callAwayState(myParser.getMyself().getAwayState(), myParser.getMyself().getAwayReason());
43
+			myParser.getLocalClient().setAwayState(sParam.equals("306"));
44
+			callAwayState(myParser.getLocalClient().getAwayState(), myParser.getLocalClient().getAwayReason());
45 45
 		}
46 46
 	}
47 47
 	

+ 3
- 3
src/com/dmdirc/parser/irc/ProcessJoin.java Прегледај датотеку

@@ -50,7 +50,7 @@ public class ProcessJoin extends IRCProcessor {
50 50
 			// :nick!ident@host JOIN (:)#Channel
51 51
 			Byte nTemp;
52 52
 			if (token.length < 3) { return; }
53
-			ClientInfo iClient;
53
+			IRCClientInfo iClient;
54 54
 			IRCChannelInfo iChannel;
55 55
 			ChannelClientInfo iChannelClient;
56 56
 			
@@ -58,13 +58,13 @@ public class ProcessJoin extends IRCProcessor {
58 58
 			iChannel = myParser.getChannel(token[token.length-1]);
59 59
 			
60 60
 			if (iClient == null) { 
61
-				iClient = new ClientInfo(myParser, token[0]);
61
+				iClient = new IRCClientInfo(myParser, token[0]);
62 62
 				myParser.addClient(iClient);
63 63
 			}
64 64
 			// Check to see if we know the host/ident for this client to facilitate dmdirc Formatter
65 65
 			if (iClient.getHost().isEmpty()) { iClient.setUserBits(token[0],false); }
66 66
 			if (iChannel != null) {
67
-				if (iClient == myParser.getMyself()) {
67
+				if (iClient == myParser.getLocalClient()) {
68 68
 					try {
69 69
 						if (iChannel.getUser(iClient) != null) {
70 70
 							// If we are joining a channel we are already on, fake a part from

+ 4
- 4
src/com/dmdirc/parser/irc/ProcessKick.java Прегледај датотеку

@@ -41,8 +41,8 @@ public class ProcessKick extends IRCProcessor {
41 41
 		ChannelClientInfo iChannelClient;
42 42
 		ChannelClientInfo iChannelKicker;
43 43
 		ChannelInfo iChannel;
44
-		ClientInfo iClient;
45
-		ClientInfo iKicker;
44
+		IRCClientInfo iClient;
45
+		IRCClientInfo iKicker;
46 46
 		String sReason = "";
47 47
 		
48 48
 		iClient = getClientInfo(token[3]);
@@ -57,7 +57,7 @@ public class ProcessKick extends IRCProcessor {
57 57
 		}
58 58
 
59 59
 		if (iChannel == null) { 
60
-			if (iClient != myParser.getMyself()) {
60
+			if (iClient != myParser.getLocalClient()) {
61 61
 				callErrorInfo(new ParserError(ParserError.ERROR_WARNING, "Got kick for channel ("+token[2]+") that I am not on. [User: "+token[3]+"]", myParser.getLastLine()));
62 62
 			}
63 63
 			return;
@@ -72,7 +72,7 @@ public class ProcessKick extends IRCProcessor {
72 72
 			if (myParser.removeAfterCallback) { callChannelKick(iChannel,iChannelClient,iChannelKicker,sReason,token[0]); }
73 73
 			iChannel.delClient(iClient);
74 74
 			if (!myParser.removeAfterCallback) { callChannelKick(iChannel,iChannelClient,iChannelKicker,sReason,token[0]); }
75
-			if (iClient == myParser.getMyself()) {
75
+			if (iClient == myParser.getLocalClient()) {
76 76
 				iChannel.emptyChannel();
77 77
 				myParser.removeChannel(iChannel);
78 78
 			}

+ 8
- 8
src/com/dmdirc/parser/irc/ProcessMessage.java Прегледај датотеку

@@ -91,7 +91,7 @@ public class ProcessMessage extends IRCProcessor {
91 91
 		
92 92
 		ChannelClientInfo iChannelClient = null;
93 93
 		ChannelInfo iChannel = null;
94
-		ClientInfo iClient = null;
94
+		IRCClientInfo iClient = null;
95 95
 		// "nick!user@host PRIVMSG #Channel" should be processed as "nick!user@host PRIVMSG #Channel :"
96 96
 		if (token.length < 4) {
97 97
 			sMessage = "";
@@ -239,7 +239,7 @@ public class ProcessMessage extends IRCProcessor {
239 239
 	 * @param sHost Hostname of sender (or servername)
240 240
 	 * @return true if a method was called, false otherwise
241 241
 	 */
242
-	protected boolean callChannelAction(final IRCChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sMessage, final String sHost) {
242
+	protected boolean callChannelAction(final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sMessage, final String sHost) {
243 243
 		return getCallbackManager().getCallbackType(ChannelActionListener.class).call(cChannel, cChannelClient, sMessage, sHost);
244 244
 	}
245 245
 	
@@ -254,7 +254,7 @@ public class ProcessMessage extends IRCProcessor {
254 254
 	 * @param sHost Hostname of sender (or servername)
255 255
 	 * @return true if a method was called, false otherwise
256 256
 	 */
257
-	protected boolean callChannelCTCP(final IRCChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sType, final String sMessage, final String sHost) {
257
+	protected boolean callChannelCTCP(final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sType, final String sMessage, final String sHost) {
258 258
 		return getCallbackManager().getCallbackType(ChannelCtcpListener.class).call(cChannel, cChannelClient, sType, sMessage, sHost);
259 259
 	}
260 260
 
@@ -269,7 +269,7 @@ public class ProcessMessage extends IRCProcessor {
269 269
 	 * @param sHost Hostname of sender (or servername)
270 270
 	 * @return true if a method was called, false otherwise
271 271
 	 */
272
-	protected boolean callChannelCTCPReply(final IRCChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sType, final String sMessage, final String sHost) {
272
+	protected boolean callChannelCTCPReply(final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sType, final String sMessage, final String sHost) {
273 273
 		return getCallbackManager().getCallbackType(ChannelCtcpReplyListener.class).call(cChannel, cChannelClient, sType, sMessage, sHost);
274 274
 	}
275 275
 	
@@ -283,7 +283,7 @@ public class ProcessMessage extends IRCProcessor {
283 283
 	 * @param sHost Hostname of sender (or servername)
284 284
 	 * @return true if a method was called, false otherwise
285 285
 	 */
286
-	protected boolean callChannelMessage(final IRCChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sMessage, final String sHost) {
286
+	protected boolean callChannelMessage(final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sMessage, final String sHost) {
287 287
 		return getCallbackManager().getCallbackType(ChannelMessageListener.class).call(cChannel, cChannelClient, sMessage, sHost);
288 288
 	}
289 289
 	
@@ -297,7 +297,7 @@ public class ProcessMessage extends IRCProcessor {
297 297
 	 * @param sHost Hostname of sender (or servername)
298 298
 	 * @return true if a method was called, false otherwise
299 299
 	 */
300
-	protected boolean callChannelNotice(final IRCChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sMessage, final String sHost) {
300
+	protected boolean callChannelNotice(final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sMessage, final String sHost) {
301 301
 		return getCallbackManager().getCallbackType(ChannelNoticeListener.class).call(cChannel, cChannelClient, sMessage, sHost);
302 302
 	}
303 303
 	
@@ -312,7 +312,7 @@ public class ProcessMessage extends IRCProcessor {
312 312
 	 * @param sHost Hostname of sender (or servername)
313 313
 	 * @return true if a method was called, false otherwise
314 314
 	 */
315
-	protected boolean callChannelModeNotice(final char prefix, final IRCChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sMessage, final String sHost) {
315
+	protected boolean callChannelModeNotice(final char prefix, final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sMessage, final String sHost) {
316 316
 		return getCallbackManager().getCallbackType(ChannelModeNoticeListener.class).call(prefix, cChannel, cChannelClient, sMessage, sHost);
317 317
 	}
318 318
 	
@@ -327,7 +327,7 @@ public class ProcessMessage extends IRCProcessor {
327 327
 	 * @param sHost Hostname of sender (or servername)
328 328
 	 * @return true if a method was called, false otherwise
329 329
 	 */
330
-	protected boolean callChannelModeMessage(final char prefix, final IRCChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sMessage, final String sHost) {
330
+	protected boolean callChannelModeMessage(final char prefix, final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sMessage, final String sHost) {
331 331
 		return getCallbackManager().getCallbackType(ChannelModeMessageListener.class).call(prefix, cChannel, cChannelClient, sMessage, sHost);
332 332
 	}
333 333
 	

+ 6
- 8
src/com/dmdirc/parser/irc/ProcessMode.java Прегледај датотеку

@@ -23,6 +23,7 @@
23 23
 package com.dmdirc.parser.irc;
24 24
 
25 25
 import com.dmdirc.parser.interfaces.ChannelInfo;
26
+import com.dmdirc.parser.interfaces.ClientInfo;
26 27
 import com.dmdirc.parser.interfaces.callbacks.ChannelModeChangeListener;
27 28
 import com.dmdirc.parser.interfaces.callbacks.ChannelNonUserModeChangeListener;
28 29
 import com.dmdirc.parser.interfaces.callbacks.ChannelSingleModeChangeListener;
@@ -91,7 +92,7 @@ public class ProcessMode extends IRCProcessor {
91 92
 		char cPositive = '+';
92 93
 		ChannelInfo iChannel;
93 94
 		ChannelClientInfo iChannelClientInfo;
94
-		ClientInfo iClient;
95
+		IRCClientInfo iClient;
95 96
 		ChannelClientInfo setterCCI;
96 97
 		
97 98
 		CallbackObject cbSingle = null;
@@ -141,11 +142,9 @@ public class ProcessMode extends IRCProcessor {
141 142
 					iChannelClientInfo = iChannel.getUser(sModeParam);
142 143
 					if (iChannelClientInfo == null) {
143 144
 						// Client not known?
144
-//						callErrorInfo(new ParserError(ParserError.ERROR_WARNING, "Got mode for client not known on channel - Added", myParser.getLastLine()));
145 145
 						iClient = getClientInfo(sModeParam);
146 146
 						if (iClient == null) { 
147
-//							callErrorInfo(new ParserError(ParserError.ERROR_WARNING, "Got mode for client not known at all - Added", myParser.getLastLine()));
148
-							iClient = new ClientInfo(myParser, sModeParam);
147
+							iClient = new IRCClientInfo(myParser, sModeParam);
149 148
 							myParser.addClient(iClient);
150 149
 						}
151 150
 						iChannelClientInfo = iChannel.addClient(iClient);
@@ -158,7 +157,6 @@ public class ProcessMode extends IRCProcessor {
158 157
 					continue;
159 158
 				} else {
160 159
 					// unknown mode - add as boolean
161
-//					callErrorInfo(new ParserError(ParserError.ERROR_WARNING, "Got unknown mode "+cMode+" - Added as boolean mode", myParser.getLastLine()));
162 160
 					myParser.hChanModesBool.put(cMode,myParser.nNextKeyCMBool);
163 161
 					nValue = myParser.nNextKeyCMBool;
164 162
 					bBooleanMode = true;
@@ -230,7 +228,7 @@ public class ProcessMode extends IRCProcessor {
230 228
 		long nCurrent = 0, nValue = 0;
231 229
 		boolean bPositive = true;
232 230
 		
233
-		ClientInfo iClient;
231
+		IRCClientInfo iClient;
234 232
 		
235 233
 		iClient = getClientInfo(token[2]);
236 234
 		if (iClient == null) { return; }
@@ -280,7 +278,7 @@ public class ProcessMode extends IRCProcessor {
280 278
 	 * @param sModes Exact String parsed
281 279
 	 * @return true if a method was called, false otherwise
282 280
 	 */
283
-	protected boolean callChannelModeChanged(IRCChannelInfo cChannel, ChannelClientInfo cChannelClient, String sHost, String sModes) {
281
+	protected boolean callChannelModeChanged(ChannelInfo cChannel, ChannelClientInfo cChannelClient, String sHost, String sModes) {
284 282
 		return getCallbackManager().getCallbackType(ChannelModeChangeListener.class).call(cChannel, cChannelClient, sHost, sModes);
285 283
 	}
286 284
 	
@@ -295,7 +293,7 @@ public class ProcessMode extends IRCProcessor {
295 293
 	 * @param sHost Host doing the mode changing (User host or server name)
296 294
 	 * @return true if a method was called, false otherwise
297 295
 	 */
298
-	protected boolean callChannelUserModeChanged(IRCChannelInfo cChannel, ChannelClientInfo cChangedClient, ChannelClientInfo cSetByClient, String sHost, String sMode) {
296
+	protected boolean callChannelUserModeChanged(ChannelInfo cChannel, ChannelClientInfo cChangedClient, ChannelClientInfo cSetByClient, String sHost, String sMode) {
299 297
 		return getCallbackManager().getCallbackType(ChannelUserModeChangeListener.class).call(cChannel, cChangedClient, cSetByClient, sHost, sMode);
300 298
 	}
301 299
 	

+ 3
- 3
src/com/dmdirc/parser/irc/ProcessNames.java Прегледај датотеку

@@ -54,7 +54,7 @@ public class ProcessNames extends IRCProcessor {
54 54
 		} else {
55 55
 			// Names
56 56
 			
57
-			ClientInfo iClient;
57
+			IRCClientInfo iClient;
58 58
 			ChannelClientInfo iChannelClient;
59 59
 			
60 60
 			iChannel = getChannel(token[4]);
@@ -90,7 +90,7 @@ public class ProcessNames extends IRCProcessor {
90 90
 				callDebugInfo(IRCParser.DEBUG_INFO, "Name: %s Modes: \"%s\" [%d]",sName,sModes.toString(),nPrefix);
91 91
 				
92 92
 				iClient = getClientInfo(sName);
93
-				if (iClient == null) { iClient = new ClientInfo(myParser, sName); myParser.addClient(iClient); }
93
+				if (iClient == null) { iClient = new IRCClientInfo(myParser, sName); myParser.addClient(iClient); }
94 94
 				iChannelClient = iChannel.addClient(iClient);
95 95
 				iChannelClient.setChanMode(nPrefix);
96 96
 
@@ -108,7 +108,7 @@ public class ProcessNames extends IRCProcessor {
108 108
 	 * @param cChannel Channel which the names reply is for
109 109
 	 * @return true if a method was called, false otherwise
110 110
 	 */
111
-	protected boolean callChannelGotNames(IRCChannelInfo cChannel) {
111
+	protected boolean callChannelGotNames(ChannelInfo cChannel) {
112 112
 		return getCallbackManager().getCallbackType(ChannelNamesListener.class).call(cChannel);
113 113
 	}
114 114
 	

+ 6
- 5
src/com/dmdirc/parser/irc/ProcessNick.java Прегледај датотеку

@@ -22,6 +22,7 @@
22 22
 
23 23
 package com.dmdirc.parser.irc;
24 24
 
25
+import com.dmdirc.parser.interfaces.ChannelInfo;
25 26
 import com.dmdirc.parser.interfaces.callbacks.ChannelNickChangeListener;
26 27
 import com.dmdirc.parser.interfaces.callbacks.NickChangeListener;
27 28
 
@@ -37,7 +38,7 @@ public class ProcessNick extends IRCProcessor {
37 38
 	 */
38 39
 	@Override
39 40
 	public void process(String sParam, String[] token) {
40
-		ClientInfo iClient;
41
+		IRCClientInfo iClient;
41 42
 		ChannelClientInfo iChannelClient;
42 43
 		String oldNickname;
43 44
 		
@@ -61,7 +62,7 @@ public class ProcessNick extends IRCProcessor {
61 62
 					myParser.addClient(iClient);
62 63
 				}
63 64
 				
64
-				for (IRCChannelInfo iChannel : myParser.getChannels()) {
65
+				for (ChannelInfo iChannel : myParser.getChannels()) {
65 66
 					// Find the user (using the old nickname)
66 67
 					iChannelClient = iChannel.getUser(oldNickname);
67 68
 					if (iChannelClient != null) {
@@ -71,11 +72,11 @@ public class ProcessNick extends IRCProcessor {
71 72
 						if (!isSameNick) {
72 73
 							iChannel.renameClient(oldNickname, iChannelClient);
73 74
 						}
74
-						callChannelNickChanged(iChannel,iChannelClient,ClientInfo.parseHost(token[0]));
75
+						callChannelNickChanged(iChannel,iChannelClient,IRCClientInfo.parseHost(token[0]));
75 76
 					}
76 77
 				}
77 78
 				
78
-				callNickChanged(iClient, ClientInfo.parseHost(token[0]));
79
+				callNickChanged(iClient, IRCClientInfo.parseHost(token[0]));
79 80
 			}
80 81
 		}
81 82
 		
@@ -102,7 +103,7 @@ public class ProcessNick extends IRCProcessor {
102 103
 	 * @param sOldNick Nickname before change
103 104
 	 * @return true if a method was called, false otherwise
104 105
 	 */
105
-	protected boolean callNickChanged(ClientInfo cClient, String sOldNick) {
106
+	protected boolean callNickChanged(IRCClientInfo cClient, String sOldNick) {
106 107
 		return getCallbackManager().getCallbackType(NickChangeListener.class).call(cClient, sOldNick);
107 108
 	}
108 109
 	

+ 4
- 4
src/com/dmdirc/parser/irc/ProcessPart.java Прегледај датотеку

@@ -41,7 +41,7 @@ public class ProcessPart extends IRCProcessor {
41 41
 		// :nick!ident@host PART #Channel
42 42
 		// :nick!ident@host PART #Channel :reason
43 43
 		if (token.length < 3) { return; }
44
-		ClientInfo iClient;
44
+		IRCClientInfo iClient;
45 45
 		ChannelInfo iChannel;
46 46
 		ChannelClientInfo iChannelClient;
47 47
 		
@@ -54,7 +54,7 @@ public class ProcessPart extends IRCProcessor {
54 54
 			iClient.setUserBits(token[0],false);
55 55
 		}
56 56
 		if (iChannel == null) { 
57
-			if (iClient != myParser.getMyself()) {
57
+			if (iClient != myParser.getLocalClient()) {
58 58
 				callErrorInfo(new ParserError(ParserError.ERROR_WARNING, "Got part for channel ("+token[2]+") that I am not on. [User: "+token[0]+"]", myParser.getLastLine()));
59 59
 			}
60 60
 			return;
@@ -70,7 +70,7 @@ public class ProcessPart extends IRCProcessor {
70 70
 			callDebugInfo(IRCParser.DEBUG_INFO, "Removing %s from %s",iClient.getNickname(),iChannel.getName());
71 71
 			iChannel.delClient(iClient);
72 72
 			if (!myParser.removeAfterCallback) { callChannelPart(iChannel,iChannelClient,sReason); }
73
-			if (iClient == myParser.getMyself()) {
73
+			if (iClient == myParser.getLocalClient()) {
74 74
 				iChannel.emptyChannel();
75 75
 				myParser.removeChannel(iChannel);
76 76
 			}
@@ -86,7 +86,7 @@ public class ProcessPart extends IRCProcessor {
86 86
 	 * @param sReason Reason given for parting (May be "")
87 87
 	 * @return true if a method was called, false otherwise
88 88
 	 */
89
-	protected boolean callChannelPart(final IRCChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sReason) {
89
+	protected boolean callChannelPart(final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sReason) {
90 90
 		return getCallbackManager().getCallbackType(ChannelPartListener.class).call(cChannel, cChannelClient, sReason);
91 91
 	}
92 92
 	

+ 8
- 6
src/com/dmdirc/parser/irc/ProcessQuit.java Прегледај датотеку

@@ -22,6 +22,8 @@
22 22
 
23 23
 package com.dmdirc.parser.irc;
24 24
 
25
+import com.dmdirc.parser.interfaces.ChannelInfo;
26
+import com.dmdirc.parser.interfaces.ClientInfo;
25 27
 import com.dmdirc.parser.interfaces.callbacks.ChannelQuitListener;
26 28
 import com.dmdirc.parser.interfaces.callbacks.QuitListener;
27 29
 import java.util.ArrayList;
@@ -42,7 +44,7 @@ public class ProcessQuit extends IRCProcessor {
42 44
 		// :nick!ident@host QUIT
43 45
 		// :nick!ident@host QUIT :reason
44 46
 		if (token.length < 2) { return; }
45
-		ClientInfo iClient;
47
+		IRCClientInfo iClient;
46 48
 		ChannelClientInfo iChannelClient;
47 49
 		
48 50
 		iClient = getClientInfo(token[0]);
@@ -55,12 +57,12 @@ public class ProcessQuit extends IRCProcessor {
55 57
 		String sReason = "";
56 58
 		if (token.length > 2) { sReason = token[token.length-1]; }
57 59
 		
58
-		ArrayList<IRCChannelInfo> channelList = new ArrayList<IRCChannelInfo>(myParser.getChannels());
59
-		for (IRCChannelInfo iChannel : channelList) {
60
+		ArrayList<ChannelInfo> channelList = new ArrayList<ChannelInfo>(myParser.getChannels());
61
+		for (ChannelInfo iChannel : channelList) {
60 62
 			iChannelClient = iChannel.getUser(iClient);
61 63
 			if (iChannelClient != null) {
62 64
 				if (myParser.removeAfterCallback) { callChannelQuit(iChannel,iChannelClient,sReason); }
63
-				if (iClient == myParser.getMyself()) {
65
+				if (iClient == myParser.getLocalClient()) {
64 66
 					iChannel.emptyChannel();
65 67
 					myParser.removeChannel(iChannel);
66 68
 				} else {
@@ -71,7 +73,7 @@ public class ProcessQuit extends IRCProcessor {
71 73
 		}
72 74
 
73 75
 		if (myParser.removeAfterCallback) { callQuit(iClient,sReason); }
74
-		if (iClient == myParser.getMyself()) {
76
+		if (iClient == myParser.getLocalClient()) {
75 77
 			myParser.clearClients();
76 78
 		} else {
77 79
 			myParser.removeClient(iClient);
@@ -88,7 +90,7 @@ public class ProcessQuit extends IRCProcessor {
88 90
 	 * @param sReason Quit reason
89 91
 	 * @return true if a method was called, false otherwise
90 92
 	 */
91
-	protected boolean callChannelQuit(final IRCChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sReason) {
93
+	protected boolean callChannelQuit(final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sReason) {
92 94
 		return getCallbackManager().getCallbackType(ChannelQuitListener.class).call(cChannel, cChannelClient, sReason);
93 95
 	}
94 96
 	

+ 1
- 1
src/com/dmdirc/parser/irc/ProcessTopic.java Прегледај датотеку

@@ -56,7 +56,7 @@ public class ProcessTopic extends IRCProcessor {
56 56
 			}
57 57
 		} else {
58 58
 			if (IRCParser.ALWAYS_UPDATECLIENT) {
59
-				final ClientInfo iClient = getClientInfo(token[0]);
59
+				final IRCClientInfo iClient = getClientInfo(token[0]);
60 60
 				if (iClient != null && iClient.getHost().isEmpty()) {iClient.setUserBits(token[0],false); }
61 61
 			}
62 62
 			iChannel = getChannel(token[2]);

+ 5
- 3
src/com/dmdirc/parser/irc/ProcessWho.java Прегледај датотеку

@@ -22,6 +22,8 @@
22 22
 
23 23
 package com.dmdirc.parser.irc;
24 24
 
25
+import com.dmdirc.parser.interfaces.ChannelInfo;
26
+import com.dmdirc.parser.interfaces.ClientInfo;
25 27
 import com.dmdirc.parser.interfaces.callbacks.AwayStateListener;
26 28
 import com.dmdirc.parser.interfaces.callbacks.ChannelOtherAwayStateListener;
27 29
 import com.dmdirc.parser.interfaces.callbacks.OtherAwayStateListener;
@@ -62,13 +64,13 @@ public class ProcessWho extends IRCProcessor {
62 64
 			if (client.getAwayState() != isAway) {
63 65
 				client.setAwayState(isAway);
64 66
 				if (!isAway) { client.setAwayReason(""); }
65
-				if (client == myParser.getMyself()) {
67
+				if (client == myParser.getLocalClient()) {
66 68
 					callAwayState(client.getAwayState(), client.getAwayReason());
67 69
 				} else {
68 70
 					callAwayStateOther(client, isAway);
69 71
 					
70 72
 					ChannelClientInfo iChannelClient;
71
-					for (IRCChannelInfo iChannel : myParser.getChannels()) {
73
+					for (ChannelInfo iChannel : myParser.getChannels()) {
72 74
 						iChannelClient = iChannel.getUser(client);
73 75
 						if (iChannelClient != null) {
74 76
 							callChannelAwayStateOther(iChannel,iChannelClient,isAway);
@@ -112,7 +114,7 @@ public class ProcessWho extends IRCProcessor {
112 114
 	 * @param state Away State (true if away, false if here)
113 115
 	 * @return true if a method was called, false otherwise
114 116
 	 */
115
-	protected boolean callChannelAwayStateOther(final IRCChannelInfo channel, final ChannelClientInfo channelClient, final boolean state) {
117
+	protected boolean callChannelAwayStateOther(final ChannelInfo channel, final ChannelClientInfo channelClient, final boolean state) {
116 118
 		return getCallbackManager().getCallbackType(ChannelOtherAwayStateListener.class).call(channel, channelClient, state);
117 119
 	}
118 120
 	

+ 6
- 6
src/com/dmdirc/parser/irc/callbacks/CallbackObjectSpecific.java Прегледај датотеку

@@ -22,9 +22,9 @@
22 22
 
23 23
 package com.dmdirc.parser.irc.callbacks;
24 24
 
25
+import com.dmdirc.parser.interfaces.ChannelInfo;
26
+import com.dmdirc.parser.interfaces.ClientInfo;
25 27
 import com.dmdirc.parser.interfaces.Parser;
26
-import com.dmdirc.parser.irc.IRCChannelInfo;
27
-import com.dmdirc.parser.irc.ClientInfo;
28 28
 import com.dmdirc.parser.irc.ParserError;
29 29
 import com.dmdirc.parser.interfaces.callbacks.CallbackInterface;
30 30
 
@@ -62,7 +62,7 @@ public class CallbackObjectSpecific extends CallbackObject {
62 62
 	 * @param cChannel ChannelInfo object for the channel to test
63 63
 	 * @return true if channel given matches the specifics for the method given
64 64
 	 */
65
-	protected boolean isValidChan(final CallbackInterface eMethod, final IRCChannelInfo cChannel) {
65
+	protected boolean isValidChan(final CallbackInterface eMethod, final ChannelInfo cChannel) {
66 66
 		if (specificData.containsKey(eMethod)) { 
67 67
 			if (!myParser.getIRCStringConverter().equalsIgnoreCase(cChannel.getName(), specificData.get(eMethod))) { return false; }
68 68
 		}
@@ -144,9 +144,9 @@ public class CallbackObjectSpecific extends CallbackObject {
144 144
             if (type.isAnnotationPresent(SpecificCallback.class) &&
145 145
                     ((args[0] instanceof ClientInfo
146 146
                         && !isValidUser(iface, ((ClientInfo) args[0]).getHost()))
147
-                        || (args[0] instanceof IRCChannelInfo
148
-                        && !isValidChan(iface, (IRCChannelInfo) args[0]))
149
-                        || (!(args[0] instanceof ClientInfo || args[0] instanceof IRCChannelInfo) &&
147
+                        || (args[0] instanceof ChannelInfo
148
+                        && !isValidChan(iface, (ChannelInfo) args[0]))
149
+                        || (!(args[0] instanceof ClientInfo || args[0] instanceof ChannelInfo) &&
150 150
                         args[args.length - 1] instanceof String
151 151
                         && !isValidUser(iface, (String) args[args.length - 1])))) {
152 152
                 continue;

+ 2
- 2
test/com/dmdirc/harness/parser/TestINickChanged.java Прегледај датотеку

@@ -28,10 +28,10 @@ import com.dmdirc.parser.interfaces.callbacks.NickChangeListener;
28 28
 public class TestINickChanged implements NickChangeListener {
29 29
 
30 30
     public String oldNick = null;
31
-    public ClientInfo client;
31
+    public IRCClientInfo client;
32 32
 
33 33
     @Override
34
-    public void onNickChanged(IRCParser tParser, ClientInfo cClient,
34
+    public void onNickChanged(IRCParser tParser, IRCClientInfo cClient,
35 35
                               String sOldNick) {
36 36
         oldNick = sOldNick;
37 37
         client = cClient;

+ 2
- 2
test/com/dmdirc/harness/parser/TestIQuit.java Прегледај датотеку

@@ -32,7 +32,7 @@ public class TestIQuit implements ChannelQuitListener, QuitListener {
32 32
 
33 33
     public ChannelClientInfo cclient;
34 34
 
35
-    public ClientInfo client;
35
+    public IRCClientInfo client;
36 36
 
37 37
     public String reason;
38 38
 
@@ -46,7 +46,7 @@ public class TestIQuit implements ChannelQuitListener, QuitListener {
46 46
         this.count++;
47 47
     }
48 48
 
49
-    public void onQuit(IRCParser tParser, ClientInfo cClient, String sReason) {
49
+    public void onQuit(IRCParser tParser, IRCClientInfo cClient, String sReason) {
50 50
         this.client = cClient;
51 51
         this.reason = sReason;
52 52
         this.count++;

+ 16
- 16
test/com/dmdirc/parser/irc/ClientInfoTest.java Прегледај датотеку

@@ -32,7 +32,7 @@ public class ClientInfoTest {
32 32
     
33 33
     @Test
34 34
     public void testMap() {
35
-        final ClientInfo ci = new ClientInfo(null, "nick!ident@host");
35
+        final IRCClientInfo ci = new IRCClientInfo(null, "nick!ident@host");
36 36
         final Map map = new HashMap();
37 37
         
38 38
         ci.setMap(map);
@@ -41,7 +41,7 @@ public class ClientInfoTest {
41 41
     
42 42
     @Test
43 43
     public void testFake() {
44
-        final ClientInfo ci = new ClientInfo(null, "nick!ident@host");
44
+        final IRCClientInfo ci = new IRCClientInfo(null, "nick!ident@host");
45 45
         assertFalse(ci.isFake());
46 46
         ci.setFake(true);
47 47
         assertTrue(ci.isFake());
@@ -55,9 +55,9 @@ public class ClientInfoTest {
55 55
         final String string2 = "nick";
56 56
         final String string3 = ":nick@host";
57 57
         
58
-        assertEquals("nick", ClientInfo.parseHost(string1));
59
-        assertEquals("nick", ClientInfo.parseHost(string2));
60
-        assertEquals("nick", ClientInfo.parseHost(string3));
58
+        assertEquals("nick", IRCClientInfo.parseHost(string1));
59
+        assertEquals("nick", IRCClientInfo.parseHost(string2));
60
+        assertEquals("nick", IRCClientInfo.parseHost(string3));
61 61
     }
62 62
     
63 63
     @Test
@@ -66,18 +66,18 @@ public class ClientInfoTest {
66 66
         final String string2 = "nick";
67 67
         final String string3 = ":nick@host";
68 68
         
69
-        assertEquals("nick", ClientInfo.parseHostFull(string1)[0]);
70
-        assertEquals("ident", ClientInfo.parseHostFull(string1)[1]);
71
-        assertEquals("host", ClientInfo.parseHostFull(string1)[2]);
69
+        assertEquals("nick", IRCClientInfo.parseHostFull(string1)[0]);
70
+        assertEquals("ident", IRCClientInfo.parseHostFull(string1)[1]);
71
+        assertEquals("host", IRCClientInfo.parseHostFull(string1)[2]);
72 72
         
73
-        assertEquals("nick", ClientInfo.parseHostFull(string2)[0]);
74
-        assertEquals("nick", ClientInfo.parseHostFull(string3)[0]);
75
-        assertEquals("host", ClientInfo.parseHostFull(string3)[2]);
73
+        assertEquals("nick", IRCClientInfo.parseHostFull(string2)[0]);
74
+        assertEquals("nick", IRCClientInfo.parseHostFull(string3)[0]);
75
+        assertEquals("host", IRCClientInfo.parseHostFull(string3)[2]);
76 76
     }
77 77
     
78 78
     @Test
79 79
     public void testSetUserBits() {
80
-        final ClientInfo ci = new ClientInfo(null, "nick!ident@host");
80
+        final IRCClientInfo ci = new IRCClientInfo(null, "nick!ident@host");
81 81
         ci.setUserBits("nick2!ident2@host2", false);
82 82
         
83 83
         assertEquals("nick", ci.getNickname());
@@ -93,13 +93,13 @@ public class ClientInfoTest {
93 93
     
94 94
     @Test
95 95
     public void testToString() {
96
-        final ClientInfo ci = new ClientInfo(null, "nick!ident@host");
96
+        final IRCClientInfo ci = new IRCClientInfo(null, "nick!ident@host");
97 97
         assertEquals("nick!ident@host", ci.toString());
98 98
     }
99 99
     
100 100
     @Test
101 101
     public void testAwayState() {
102
-        final ClientInfo ci = new ClientInfo(null, "nick!ident@host");
102
+        final IRCClientInfo ci = new IRCClientInfo(null, "nick!ident@host");
103 103
         assertFalse(ci.getAwayState());
104 104
         ci.setAwayState(true);
105 105
         assertTrue(ci.getAwayState());
@@ -107,7 +107,7 @@ public class ClientInfoTest {
107 107
     
108 108
     @Test
109 109
     public void testAwayReason() {
110
-        final ClientInfo ci = new ClientInfo(null, "nick!ident@host");
110
+        final IRCClientInfo ci = new IRCClientInfo(null, "nick!ident@host");
111 111
         ci.setAwayState(true);
112 112
         ci.setAwayReason("away reason");
113 113
         
@@ -118,7 +118,7 @@ public class ClientInfoTest {
118 118
     
119 119
     @Test
120 120
     public void testRealName() {
121
-        final ClientInfo ci = new ClientInfo(null, "nick!ident@host");
121
+        final IRCClientInfo ci = new IRCClientInfo(null, "nick!ident@host");
122 122
         ci.setRealName("abc def");
123 123
         assertEquals("abc def", ci.getRealName());
124 124
         ci.setRealName("abc 123 def");

Loading…
Откажи
Сачувај