Browse Source

Abstract CommandInfos somewhat

tags/0.6.3m2a1
Chris Smith 15 years ago
parent
commit
038fdfbd8f
65 changed files with 267 additions and 220 deletions
  1. 6
    5
      src/com/dmdirc/Channel.java
  2. 14
    14
      src/com/dmdirc/ChannelEventHandler.java
  3. 2
    2
      src/com/dmdirc/Server.java
  4. 2
    2
      src/com/dmdirc/ServerEventHandler.java
  5. 4
    4
      src/com/dmdirc/addons/logging/LoggingPlugin.java
  6. 2
    2
      src/com/dmdirc/addons/nickcolours/NickColourPlugin.java
  7. 2
    2
      src/com/dmdirc/addons/windowstatus/WindowStatusPlugin.java
  8. 2
    2
      src/com/dmdirc/commandparser/commands/channel/Mode.java
  9. 2
    2
      src/com/dmdirc/commandparser/commands/channel/ShowTopic.java
  10. 34
    0
      src/com/dmdirc/parser/interfaces/ChannelInfo.java
  11. 9
    0
      src/com/dmdirc/parser/interfaces/Parser.java
  12. 2
    2
      src/com/dmdirc/parser/interfaces/callbacks/ChannelActionListener.java
  13. 2
    2
      src/com/dmdirc/parser/interfaces/callbacks/ChannelCtcpListener.java
  14. 2
    2
      src/com/dmdirc/parser/interfaces/callbacks/ChannelCtcpReplyListener.java
  15. 2
    2
      src/com/dmdirc/parser/interfaces/callbacks/ChannelJoinListener.java
  16. 2
    2
      src/com/dmdirc/parser/interfaces/callbacks/ChannelKickListener.java
  17. 2
    2
      src/com/dmdirc/parser/interfaces/callbacks/ChannelListModeListener.java
  18. 2
    2
      src/com/dmdirc/parser/interfaces/callbacks/ChannelMessageListener.java
  19. 2
    2
      src/com/dmdirc/parser/interfaces/callbacks/ChannelModeChangeListener.java
  20. 2
    2
      src/com/dmdirc/parser/interfaces/callbacks/ChannelModeMessageListener.java
  21. 2
    2
      src/com/dmdirc/parser/interfaces/callbacks/ChannelModeNoticeListener.java
  22. 2
    2
      src/com/dmdirc/parser/interfaces/callbacks/ChannelNamesListener.java
  23. 2
    2
      src/com/dmdirc/parser/interfaces/callbacks/ChannelNickChangeListener.java
  24. 2
    2
      src/com/dmdirc/parser/interfaces/callbacks/ChannelNonUserModeChangeListener.java
  25. 2
    2
      src/com/dmdirc/parser/interfaces/callbacks/ChannelNoticeListener.java
  26. 2
    2
      src/com/dmdirc/parser/interfaces/callbacks/ChannelOtherAwayStateListener.java
  27. 2
    2
      src/com/dmdirc/parser/interfaces/callbacks/ChannelPartListener.java
  28. 2
    2
      src/com/dmdirc/parser/interfaces/callbacks/ChannelQuitListener.java
  29. 2
    2
      src/com/dmdirc/parser/interfaces/callbacks/ChannelSelfJoinListener.java
  30. 2
    2
      src/com/dmdirc/parser/interfaces/callbacks/ChannelSingleModeChangeListener.java
  31. 2
    2
      src/com/dmdirc/parser/interfaces/callbacks/ChannelTopicListener.java
  32. 2
    2
      src/com/dmdirc/parser/interfaces/callbacks/ChannelUserModeChangeListener.java
  33. 3
    3
      src/com/dmdirc/parser/irc/ChannelClientInfo.java
  34. 3
    2
      src/com/dmdirc/parser/irc/IRCChannelInfo.java
  35. 18
    21
      src/com/dmdirc/parser/irc/IRCParser.java
  36. 4
    3
      src/com/dmdirc/parser/irc/IRCProcessor.java
  37. 6
    6
      src/com/dmdirc/parser/irc/ProcessJoin.java
  38. 3
    2
      src/com/dmdirc/parser/irc/ProcessKick.java
  39. 3
    2
      src/com/dmdirc/parser/irc/ProcessListModes.java
  40. 9
    8
      src/com/dmdirc/parser/irc/ProcessMessage.java
  41. 4
    3
      src/com/dmdirc/parser/irc/ProcessMode.java
  42. 4
    3
      src/com/dmdirc/parser/irc/ProcessNames.java
  43. 2
    2
      src/com/dmdirc/parser/irc/ProcessNick.java
  44. 3
    2
      src/com/dmdirc/parser/irc/ProcessPart.java
  45. 3
    3
      src/com/dmdirc/parser/irc/ProcessQuit.java
  46. 4
    3
      src/com/dmdirc/parser/irc/ProcessTopic.java
  47. 2
    6
      src/com/dmdirc/parser/irc/ProcessWho.java
  48. 5
    5
      src/com/dmdirc/parser/irc/callbacks/CallbackObjectSpecific.java
  49. 2
    2
      test/com/dmdirc/addons/logging/LoggingPluginTest.java
  50. 4
    4
      test/com/dmdirc/commandparser/commands/channel/KickReasonTest.java
  51. 3
    3
      test/com/dmdirc/commandparser/commands/channel/ModeTest.java
  52. 3
    3
      test/com/dmdirc/commandparser/commands/channel/NamesTest.java
  53. 1
    1
      test/com/dmdirc/commandparser/commands/channel/PartTest.java
  54. 2
    2
      test/com/dmdirc/harness/parser/TestIChannelPart.java
  55. 2
    2
      test/com/dmdirc/harness/parser/TestIChannelSelfJoin.java
  56. 2
    2
      test/com/dmdirc/harness/parser/TestIChannelTopic.java
  57. 2
    2
      test/com/dmdirc/harness/parser/TestIQuit.java
  58. 23
    22
      test/com/dmdirc/parser/irc/ChannelInfoTest.java
  59. 2
    2
      test/com/dmdirc/parser/irc/IRCParserTest.java
  60. 2
    2
      test/com/dmdirc/parser/irc/ProcessJoinTest.java
  61. 3
    3
      test/com/dmdirc/parser/irc/ProcessModeTest.java
  62. 5
    5
      test/com/dmdirc/parser/irc/ProcessNamesTest.java
  63. 2
    2
      test/com/dmdirc/parser/irc/ProcessNickTest.java
  64. 4
    4
      test/com/dmdirc/parser/irc/ProcessPartTest.java
  65. 8
    8
      test/com/dmdirc/parser/irc/ProcessQuitTest.java

+ 6
- 5
src/com/dmdirc/Channel.java View File

28
 import com.dmdirc.commandparser.CommandType;
28
 import com.dmdirc.commandparser.CommandType;
29
 import com.dmdirc.config.ConfigManager;
29
 import com.dmdirc.config.ConfigManager;
30
 import com.dmdirc.interfaces.ConfigChangeListener;
30
 import com.dmdirc.interfaces.ConfigChangeListener;
31
+import com.dmdirc.parser.interfaces.ChannelInfo;
31
 import com.dmdirc.parser.irc.ChannelClientInfo;
32
 import com.dmdirc.parser.irc.ChannelClientInfo;
32
-import com.dmdirc.parser.irc.ChannelInfo;
33
+import com.dmdirc.parser.irc.IRCChannelInfo;
33
 import com.dmdirc.parser.irc.ClientInfo;
34
 import com.dmdirc.parser.irc.ClientInfo;
34
 import com.dmdirc.ui.WindowManager;
35
 import com.dmdirc.ui.WindowManager;
35
 import com.dmdirc.ui.input.TabCompleter;
36
 import com.dmdirc.ui.input.TabCompleter;
101
      * @param newChannelInfo The parser's channel object that corresponds to
102
      * @param newChannelInfo The parser's channel object that corresponds to
102
      * this channel
103
      * this channel
103
      */
104
      */
104
-    public Channel(final Server newServer, final ChannelInfo newChannelInfo) {
105
+    public Channel(final Server newServer, final IRCChannelInfo newChannelInfo) {
105
         super("channel", newChannelInfo.getName(),
106
         super("channel", newChannelInfo.getName(),
106
                 new ConfigManager(newServer.getIrcd(), newServer.getNetwork(),
107
                 new ConfigManager(newServer.getIrcd(), newServer.getNetwork(),
107
                 newServer.getName(), newChannelInfo.getName()));
108
                 newServer.getName(), newChannelInfo.getName()));
159
     @Override
160
     @Override
160
     public void sendLine(final String line) {
161
     public void sendLine(final String line) {
161
         if (server.getState() != ServerState.CONNECTED
162
         if (server.getState() != ServerState.CONNECTED
162
-                || server.getParser().getChannelInfo(channelInfo.getName()) == null) {
163
+                || server.getParser().getChannel(channelInfo.getName()) == null) {
163
             // We're not in the channel/connected to the server
164
             // We're not in the channel/connected to the server
164
             return;
165
             return;
165
         }
166
         }
194
     @Override
195
     @Override
195
     public void sendAction(final String action) {
196
     public void sendAction(final String action) {
196
         if (server.getState() != ServerState.CONNECTED
197
         if (server.getState() != ServerState.CONNECTED
197
-                || server.getParser().getChannelInfo(channelInfo.getName()) == null) {
198
+                || server.getParser().getChannel(channelInfo.getName()) == null) {
198
             // We're not on the server/channel
199
             // We're not on the server/channel
199
             return;
200
             return;
200
         }
201
         }
245
      *
246
      *
246
      * @param newChannelInfo The new ChannelInfo object
247
      * @param newChannelInfo The new ChannelInfo object
247
      */
248
      */
248
-    public void setChannelInfo(final ChannelInfo newChannelInfo) {
249
+    public void setChannelInfo(final IRCChannelInfo newChannelInfo) {
249
         channelInfo = newChannelInfo;
250
         channelInfo = newChannelInfo;
250
         registerCallbacks();
251
         registerCallbacks();
251
     }
252
     }

+ 14
- 14
src/com/dmdirc/ChannelEventHandler.java View File

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

+ 2
- 2
src/com/dmdirc/Server.java View File

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

+ 2
- 2
src/com/dmdirc/ServerEventHandler.java View File

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

+ 4
- 4
src/com/dmdirc/addons/logging/LoggingPlugin.java View File

40
 import com.dmdirc.logger.Logger;
40
 import com.dmdirc.logger.Logger;
41
 import com.dmdirc.parser.interfaces.Parser;
41
 import com.dmdirc.parser.interfaces.Parser;
42
 import com.dmdirc.parser.irc.ChannelClientInfo;
42
 import com.dmdirc.parser.irc.ChannelClientInfo;
43
-import com.dmdirc.parser.irc.ChannelInfo;
43
+import com.dmdirc.parser.irc.IRCChannelInfo;
44
 import com.dmdirc.parser.irc.ClientInfo;
44
 import com.dmdirc.parser.irc.ClientInfo;
45
 import com.dmdirc.plugins.Plugin;
45
 import com.dmdirc.plugins.Plugin;
46
 import com.dmdirc.ui.interfaces.InputWindow;
46
 import com.dmdirc.ui.interfaces.InputWindow;
312
 	 */
312
 	 */
313
 	protected void handleChannelEvent(final CoreActionType type, final StringBuffer format, final Object... arguments) {
313
 	protected void handleChannelEvent(final CoreActionType type, final StringBuffer format, final Object... arguments) {
314
 		final Channel chan = ((Channel)arguments[0]);
314
 		final Channel chan = ((Channel)arguments[0]);
315
-		final ChannelInfo channel = chan.getChannelInfo();
315
+		final IRCChannelInfo channel = chan.getChannelInfo();
316
 		final String filename = getLogFile(channel);
316
 		final String filename = getLogFile(channel);
317
 		
317
 		
318
 		final ChannelClientInfo channelClient = (arguments.length > 1 && arguments[1] instanceof ChannelClientInfo) ? (ChannelClientInfo)arguments[1] : null;
318
 		final ChannelClientInfo channelClient = (arguments.length > 1 && arguments[1] instanceof ChannelClientInfo) ? (ChannelClientInfo)arguments[1] : null;
608
 		
608
 		
609
 		if (obj == null) {
609
 		if (obj == null) {
610
 			file.append("null.log");
610
 			file.append("null.log");
611
-		} else if (obj instanceof ChannelInfo) {
612
-			final ChannelInfo channel = (ChannelInfo) obj;
611
+		} else if (obj instanceof IRCChannelInfo) {
612
+			final IRCChannelInfo channel = (IRCChannelInfo) obj;
613
 			if (channel.getParser() != null) {
613
 			if (channel.getParser() != null) {
614
 				addNetworkDir(directory, file, channel.getParser().getNetworkName());
614
 				addNetworkDir(directory, file, channel.getParser().getNetworkName());
615
 			}
615
 			}

+ 2
- 2
src/com/dmdirc/addons/nickcolours/NickColourPlugin.java View File

34
 import com.dmdirc.config.prefs.PreferencesType;
34
 import com.dmdirc.config.prefs.PreferencesType;
35
 import com.dmdirc.interfaces.ActionListener;
35
 import com.dmdirc.interfaces.ActionListener;
36
 import com.dmdirc.parser.irc.ChannelClientInfo;
36
 import com.dmdirc.parser.irc.ChannelClientInfo;
37
-import com.dmdirc.parser.irc.ChannelInfo;
37
+import com.dmdirc.parser.irc.IRCChannelInfo;
38
 import com.dmdirc.parser.irc.ClientInfo;
38
 import com.dmdirc.parser.irc.ClientInfo;
39
 import com.dmdirc.plugins.Plugin;
39
 import com.dmdirc.plugins.Plugin;
40
 import com.dmdirc.ui.messages.ColourManager;
40
 import com.dmdirc.ui.messages.ColourManager;
67
     public void processEvent(final ActionType type, final StringBuffer format,
67
     public void processEvent(final ActionType type, final StringBuffer format,
68
             final Object... arguments) {
68
             final Object... arguments) {
69
         if (type.equals(CoreActionType.CHANNEL_GOTNAMES)) {
69
         if (type.equals(CoreActionType.CHANNEL_GOTNAMES)) {
70
-            final ChannelInfo chanInfo = ((Channel) arguments[0]).getChannelInfo();
70
+            final IRCChannelInfo chanInfo = ((Channel) arguments[0]).getChannelInfo();
71
             final String network = ((Channel) arguments[0]).getServer().getNetwork();
71
             final String network = ((Channel) arguments[0]).getServer().getNetwork();
72
             
72
             
73
             for (ChannelClientInfo client : chanInfo.getChannelClients()) {
73
             for (ChannelClientInfo client : chanInfo.getChannelClients()) {

+ 2
- 2
src/com/dmdirc/addons/windowstatus/WindowStatusPlugin.java View File

39
 import com.dmdirc.interfaces.ActionListener;
39
 import com.dmdirc.interfaces.ActionListener;
40
 import com.dmdirc.interfaces.ConfigChangeListener;
40
 import com.dmdirc.interfaces.ConfigChangeListener;
41
 import com.dmdirc.parser.irc.ChannelClientInfo;
41
 import com.dmdirc.parser.irc.ChannelClientInfo;
42
-import com.dmdirc.parser.irc.ChannelInfo;
42
+import com.dmdirc.parser.irc.IRCChannelInfo;
43
 import com.dmdirc.parser.irc.ClientInfo;
43
 import com.dmdirc.parser.irc.ClientInfo;
44
 import com.dmdirc.plugins.Plugin;
44
 import com.dmdirc.plugins.Plugin;
45
 import com.dmdirc.ui.interfaces.InputWindow;
45
 import com.dmdirc.ui.interfaces.InputWindow;
125
 			textString.append(frame.getName());
125
 			textString.append(frame.getName());
126
 		} else if (current instanceof Channel) {
126
 		} else if (current instanceof Channel) {
127
 			final Channel frame = (Channel) current;
127
 			final Channel frame = (Channel) current;
128
-			final ChannelInfo chan = frame.getChannelInfo();
128
+			final IRCChannelInfo chan = frame.getChannelInfo();
129
 			final Map<Long, String> names = new Hashtable<Long, String>();
129
 			final Map<Long, String> names = new Hashtable<Long, String>();
130
 			final Map<Long, Integer> types = new Hashtable<Long, Integer>();
130
 			final Map<Long, Integer> types = new Hashtable<Long, Integer>();
131
 
131
 

+ 2
- 2
src/com/dmdirc/commandparser/commands/channel/Mode.java View File

29
 import com.dmdirc.commandparser.CommandManager;
29
 import com.dmdirc.commandparser.CommandManager;
30
 import com.dmdirc.commandparser.commands.ExternalCommand;
30
 import com.dmdirc.commandparser.commands.ExternalCommand;
31
 import com.dmdirc.commandparser.commands.IntelligentCommand;
31
 import com.dmdirc.commandparser.commands.IntelligentCommand;
32
-import com.dmdirc.parser.irc.ChannelInfo;
32
+import com.dmdirc.parser.irc.IRCChannelInfo;
33
 import com.dmdirc.ui.input.AdditionalTabTargets;
33
 import com.dmdirc.ui.input.AdditionalTabTargets;
34
 import com.dmdirc.ui.input.TabCompletionType;
34
 import com.dmdirc.ui.input.TabCompletionType;
35
 import com.dmdirc.ui.interfaces.InputWindow;
35
 import com.dmdirc.ui.interfaces.InputWindow;
54
     @Override
54
     @Override
55
     public void execute(final InputWindow origin, final Server server,
55
     public void execute(final InputWindow origin, final Server server,
56
             final Channel channel, final boolean isSilent, final CommandArguments args) {
56
             final Channel channel, final boolean isSilent, final CommandArguments args) {
57
-        final ChannelInfo cChannel = channel.getChannelInfo();
57
+        final IRCChannelInfo cChannel = channel.getChannelInfo();
58
 
58
 
59
         if (args.getArguments().length == 0) {
59
         if (args.getArguments().length == 0) {
60
             sendLine(origin, isSilent, "channelModeDiscovered", cChannel.getModeStr(), cChannel);
60
             sendLine(origin, isSilent, "channelModeDiscovered", cChannel.getModeStr(), cChannel);

+ 2
- 2
src/com/dmdirc/commandparser/commands/channel/ShowTopic.java View File

28
 import com.dmdirc.commandparser.commands.ChannelCommand;
28
 import com.dmdirc.commandparser.commands.ChannelCommand;
29
 import com.dmdirc.commandparser.CommandManager;
29
 import com.dmdirc.commandparser.CommandManager;
30
 import com.dmdirc.commandparser.commands.ExternalCommand;
30
 import com.dmdirc.commandparser.commands.ExternalCommand;
31
-import com.dmdirc.parser.irc.ChannelInfo;
31
+import com.dmdirc.parser.irc.IRCChannelInfo;
32
 import com.dmdirc.parser.irc.ClientInfo;
32
 import com.dmdirc.parser.irc.ClientInfo;
33
 import com.dmdirc.ui.interfaces.InputWindow;
33
 import com.dmdirc.ui.interfaces.InputWindow;
34
 
34
 
50
     public void execute(final InputWindow origin, final Server server,
50
     public void execute(final InputWindow origin, final Server server,
51
             final Channel channel, final boolean isSilent, final CommandArguments args) {
51
             final Channel channel, final boolean isSilent, final CommandArguments args) {
52
         if (args.getArguments().length == 0) {
52
         if (args.getArguments().length == 0) {
53
-            final ChannelInfo cChannel = channel.getChannelInfo();
53
+            final IRCChannelInfo cChannel = channel.getChannelInfo();
54
 
54
 
55
             if (cChannel.getTopic().isEmpty()) {
55
             if (cChannel.getTopic().isEmpty()) {
56
                 sendLine(origin, isSilent, "channelNoTopic", cChannel);
56
                 sendLine(origin, isSilent, "channelNoTopic", cChannel);

+ 34
- 0
src/com/dmdirc/parser/interfaces/ChannelInfo.java View File

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 channel and allows various operations to be
27
+ * performed on the channel.
28
+ *
29
+ * @since 0.6.3m2
30
+ * @author chris
31
+ */
32
+public interface ChannelInfo {
33
+
34
+}

+ 9
- 0
src/com/dmdirc/parser/interfaces/Parser.java View File

26
  * A parser connects to a back-end chat system and handles all communication
26
  * A parser connects to a back-end chat system and handles all communication
27
  * with it.
27
  * with it.
28
  *
28
  *
29
+ * @since 0.6.3m2
29
  * @author chris
30
  * @author chris
30
  */
31
  */
31
 public interface Parser extends Runnable {
32
 public interface Parser extends Runnable {
45
      */
46
      */
46
     void joinChannel(String channel);
47
     void joinChannel(String channel);
47
 
48
 
49
+    /**
50
+     * Retrieves a channel information object for the specified channel.
51
+     *
52
+     * @param channel Name of the channel to retrieve an information object for
53
+     * @return A corresponding channel info object
54
+     */
55
+    ChannelInfo getChannel(String channel);
56
+
48
     /**
57
     /**
49
      * Set the current Value of bindIP.
58
      * Set the current Value of bindIP.
50
      *
59
      *

+ 2
- 2
src/com/dmdirc/parser/interfaces/callbacks/ChannelActionListener.java View File

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

+ 2
- 2
src/com/dmdirc/parser/interfaces/callbacks/ChannelCtcpListener.java View File

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

+ 2
- 2
src/com/dmdirc/parser/interfaces/callbacks/ChannelCtcpReplyListener.java View File

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

+ 2
- 2
src/com/dmdirc/parser/interfaces/callbacks/ChannelJoinListener.java View File

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

+ 2
- 2
src/com/dmdirc/parser/interfaces/callbacks/ChannelKickListener.java View File

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

+ 2
- 2
src/com/dmdirc/parser/interfaces/callbacks/ChannelListModeListener.java View File

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

+ 2
- 2
src/com/dmdirc/parser/interfaces/callbacks/ChannelMessageListener.java View File

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

+ 2
- 2
src/com/dmdirc/parser/interfaces/callbacks/ChannelModeChangeListener.java View File

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

+ 2
- 2
src/com/dmdirc/parser/interfaces/callbacks/ChannelModeMessageListener.java View File

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

+ 2
- 2
src/com/dmdirc/parser/interfaces/callbacks/ChannelModeNoticeListener.java View File

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

+ 2
- 2
src/com/dmdirc/parser/interfaces/callbacks/ChannelNamesListener.java View File

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

+ 2
- 2
src/com/dmdirc/parser/interfaces/callbacks/ChannelNickChangeListener.java View File

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

+ 2
- 2
src/com/dmdirc/parser/interfaces/callbacks/ChannelNonUserModeChangeListener.java View File

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

+ 2
- 2
src/com/dmdirc/parser/interfaces/callbacks/ChannelNoticeListener.java View File

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

+ 2
- 2
src/com/dmdirc/parser/interfaces/callbacks/ChannelOtherAwayStateListener.java View File

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

+ 2
- 2
src/com/dmdirc/parser/interfaces/callbacks/ChannelPartListener.java View File

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

+ 2
- 2
src/com/dmdirc/parser/interfaces/callbacks/ChannelQuitListener.java View File

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

+ 2
- 2
src/com/dmdirc/parser/interfaces/callbacks/ChannelSelfJoinListener.java View File

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

+ 2
- 2
src/com/dmdirc/parser/interfaces/callbacks/ChannelSingleModeChangeListener.java View File

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

+ 2
- 2
src/com/dmdirc/parser/interfaces/callbacks/ChannelTopicListener.java View File

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

+ 2
- 2
src/com/dmdirc/parser/interfaces/callbacks/ChannelUserModeChangeListener.java View File

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

+ 3
- 3
src/com/dmdirc/parser/irc/ChannelClientInfo.java View File

40
 	/** Reference to the parser object that owns this channelclient, Used for modes. */
40
 	/** Reference to the parser object that owns this channelclient, Used for modes. */
41
 	private final IRCParser myParser;
41
 	private final IRCParser myParser;
42
 	/** Reference to the channel object that owns this channelclient. */
42
 	/** Reference to the channel object that owns this channelclient. */
43
-	private final ChannelInfo myChannel;
43
+	private final IRCChannelInfo myChannel;
44
 	/** A Map to allow applications to attach misc data to this object */
44
 	/** A Map to allow applications to attach misc data to this object */
45
 	private Map myMap;
45
 	private Map myMap;
46
 	
46
 	
51
 	 * @param client Client that this channelclient represents
51
 	 * @param client Client that this channelclient represents
52
 	 * @param channel Channel that owns this channelclient
52
 	 * @param channel Channel that owns this channelclient
53
 	 */	
53
 	 */	
54
-	public ChannelClientInfo(final IRCParser tParser, final ClientInfo client, final ChannelInfo channel) {
54
+	public ChannelClientInfo(final IRCParser tParser, final ClientInfo client, final IRCChannelInfo channel) {
55
 		myMap = new HashMap<Object, Object>();
55
 		myMap = new HashMap<Object, Object>();
56
 		myParser = tParser;
56
 		myParser = tParser;
57
 		cClient = client;
57
 		cClient = client;
90
 	 *
90
 	 *
91
 	 * @return Channel object that owns this ChannelClient
91
 	 * @return Channel object that owns this ChannelClient
92
 	 */
92
 	 */
93
-	public ChannelInfo getChannel() { return myChannel; }
93
+	public IRCChannelInfo getChannel() { return myChannel; }
94
 	/**
94
 	/**
95
 	 * Get the nickname of the client object represented by this channelclient.
95
 	 * Get the nickname of the client object represented by this channelclient.
96
 	 *
96
 	 *

src/com/dmdirc/parser/irc/ChannelInfo.java → src/com/dmdirc/parser/irc/IRCChannelInfo.java View File

22
 
22
 
23
 package com.dmdirc.parser.irc;
23
 package com.dmdirc.parser.irc;
24
 
24
 
25
+import com.dmdirc.parser.interfaces.ChannelInfo;
25
 import java.util.ArrayList;
26
 import java.util.ArrayList;
26
 import java.util.Hashtable;
27
 import java.util.Hashtable;
27
 import java.util.HashMap;
28
 import java.util.HashMap;
37
  * @author Chris Smith
38
  * @author Chris Smith
38
  * @see IRCParser
39
  * @see IRCParser
39
  */
40
  */
40
-public class ChannelInfo {
41
+public class IRCChannelInfo implements ChannelInfo {
41
 	/**
42
 	/**
42
 	 * Boolean repreenting the status of names requests.
43
 	 * Boolean repreenting the status of names requests.
43
 	 * When this is false, any new names reply will cause current known channelclients to be removed.
44
 	 * When this is false, any new names reply will cause current known channelclients to be removed.
93
 	 * @param tParser Refernce to parser that owns this channelclient (used for modes)	 
94
 	 * @param tParser Refernce to parser that owns this channelclient (used for modes)	 
94
 	 * @param name Channel name.
95
 	 * @param name Channel name.
95
 	 */
96
 	 */
96
-	public ChannelInfo(final IRCParser tParser, final String name) {
97
+	public IRCChannelInfo(final IRCParser tParser, final String name) {
97
 		myMap = new HashMap<Object, Object>();
98
 		myMap = new HashMap<Object, Object>();
98
 		myParser = tParser;
99
 		myParser = tParser;
99
 		sName = name;
100
 		sName = name;

+ 18
- 21
src/com/dmdirc/parser/irc/IRCParser.java View File

22
 
22
 
23
 package com.dmdirc.parser.irc;
23
 package com.dmdirc.parser.irc;
24
 
24
 
25
+import com.dmdirc.parser.interfaces.ChannelInfo;
25
 import com.dmdirc.parser.interfaces.Parser;
26
 import com.dmdirc.parser.interfaces.Parser;
26
 import com.dmdirc.parser.interfaces.callbacks.ConnectErrorListener;
27
 import com.dmdirc.parser.interfaces.callbacks.ConnectErrorListener;
27
 import com.dmdirc.parser.interfaces.callbacks.DataInListener;
28
 import com.dmdirc.parser.interfaces.callbacks.DataInListener;
206
 	/** Hashtable storing all known clients based on nickname (in lowercase). */
207
 	/** Hashtable storing all known clients based on nickname (in lowercase). */
207
 	private final Map<String, ClientInfo> hClientList = new Hashtable<String, ClientInfo>();
208
 	private final Map<String, ClientInfo> hClientList = new Hashtable<String, ClientInfo>();
208
 	/** Hashtable storing all known channels based on chanel name (inc prefix - in lowercase). */
209
 	/** Hashtable storing all known channels based on chanel name (inc prefix - in lowercase). */
209
-	private final Map<String, ChannelInfo> hChannelList = new Hashtable<String, ChannelInfo>();
210
+	private final Map<String, IRCChannelInfo> hChannelList = new Hashtable<String, IRCChannelInfo>();
210
 	/** Reference to the ClientInfo object that references ourself. */
211
 	/** Reference to the ClientInfo object that references ourself. */
211
 	private ClientInfo cMyself = new ClientInfo(this, "myself").setFake(true);
212
 	private ClientInfo cMyself = new ClientInfo(this, "myself").setFake(true);
212
 	/** Hashtable storing all information gathered from 005. */
213
 	/** Hashtable storing all information gathered from 005. */
895
 		else { return new ClientInfo(this, sHost).setFake(true); }
896
 		else { return new ClientInfo(this, sHost).setFake(true); }
896
 	}
897
 	}
897
 
898
 
898
-	/**
899
-	 * Get the ChannelInfo object for a channel.
900
-	 *
901
-	 * @param sWhat This is the name of the channel.
902
-	 * @return ChannelInfo Object for the channel, or null
903
-	 */
904
-	public ChannelInfo getChannelInfo(String sWhat) {
899
+	/** {@inheritDoc} */
900
+        @Override
901
+	public ChannelInfo getChannel(String channel) {
905
 		synchronized (hChannelList) {
902
 		synchronized (hChannelList) {
906
-			sWhat = getIRCStringConverter().toLowerCase(sWhat);
907
-			if (hChannelList.containsKey(sWhat)) { return hChannelList.get(sWhat); } else { return null; }
903
+			channel = getIRCStringConverter().toLowerCase(channel);
904
+			if (hChannelList.containsKey(channel)) { return hChannelList.get(channel); } else { return null; }
908
 		}
905
 		}
909
 	}
906
 	}
910
 
907
 
943
 			// as the ircd will only reply once.
940
 			// as the ircd will only reply once.
944
 			final LinkedList<Character> foundModes = new LinkedList<Character>();
941
 			final LinkedList<Character> foundModes = new LinkedList<Character>();
945
 
942
 
946
-			final ChannelInfo channel = getChannelInfo(newLine[1]);
943
+			final ChannelInfo channel = getChannel(newLine[1]);
947
 			if (channel != null) {
944
 			if (channel != null) {
948
 				final Queue<Character> listModeQueue = channel.getListModeQueue();
945
 				final Queue<Character> listModeQueue = channel.getListModeQueue();
949
 				for (int i = 0; i < newLine[2].length() ; ++i) {
946
 				for (int i = 0; i < newLine[2].length() ; ++i) {
1484
 	 * @param sReason Reason for leaving (Nothing sent if sReason is "")
1481
 	 * @param sReason Reason for leaving (Nothing sent if sReason is "")
1485
 	 */
1482
 	 */
1486
 	public void partChannel(final String sChannelName, final String sReason) {
1483
 	public void partChannel(final String sChannelName, final String sReason) {
1487
-		if (getChannelInfo(sChannelName) == null) { return; }
1484
+		if (getChannel(sChannelName) == null) { return; }
1488
 		if (sReason.isEmpty()) {
1485
 		if (sReason.isEmpty()) {
1489
 			sendString("PART " + sChannelName);
1486
 			sendString("PART " + sChannelName);
1490
 		} else {
1487
 		} else {
1675
 	/** {@inheritDoc} */
1672
 	/** {@inheritDoc} */
1676
     @Override
1673
     @Override
1677
 	public void disconnect(final String message) {
1674
 	public void disconnect(final String message) {
1678
-                if (currentSocketState == SocketState.OPEN) {
1679
-                        currentSocketState = SocketState.CLOSING;
1680
-                        if (got001) { quit(message); }
1681
-                }
1682
-
1675
+                if (currentSocketState == SocketState.OPEN) {
1676
+                        currentSocketState = SocketState.CLOSING;
1677
+                        if (got001) { quit(message); }
1678
+                }
1679
+
1683
 		try {
1680
 		try {
1684
 			if (socket != null) { socket.close(); }
1681
 			if (socket != null) { socket.close(); }
1685
 		} catch (IOException e) {
1682
 		} catch (IOException e) {
1709
 		// Check its not ourself (PM recieved before 005)
1706
 		// Check its not ourself (PM recieved before 005)
1710
 		if (getIRCStringConverter().equalsIgnoreCase(getMyNickname(), sChannelName)) { return false; }
1707
 		if (getIRCStringConverter().equalsIgnoreCase(getMyNickname(), sChannelName)) { return false; }
1711
 		// Check if we are already on this channel
1708
 		// Check if we are already on this channel
1712
-		if (getChannelInfo(sChannelName) != null) { return true; }
1709
+		if (getChannel(sChannelName) != null) { return true; }
1713
 		// Check if we know of any valid chan prefixes
1710
 		// Check if we know of any valid chan prefixes
1714
 		if (hChanPrefix.isEmpty()) {
1711
 		if (hChanPrefix.isEmpty()) {
1715
 			// We don't. Lets check against RFC2811-Specified channel types
1712
 			// We don't. Lets check against RFC2811-Specified channel types
2082
 	 *
2079
 	 *
2083
 	 * @param channel Channel to add
2080
 	 * @param channel Channel to add
2084
 	 */
2081
 	 */
2085
-	public void addChannel(final ChannelInfo channel) {
2082
+	public void addChannel(final IRCChannelInfo channel) {
2086
 		synchronized (hChannelList) {
2083
 		synchronized (hChannelList) {
2087
 			hChannelList.put(getIRCStringConverter().toLowerCase(channel.getName()), channel);
2084
 			hChannelList.put(getIRCStringConverter().toLowerCase(channel.getName()), channel);
2088
 		}
2085
 		}
2093
 	 *
2090
 	 *
2094
 	 * @param channel Channel to remove
2091
 	 * @param channel Channel to remove
2095
 	 */
2092
 	 */
2096
-	public void removeChannel(final ChannelInfo channel) {
2093
+	public void removeChannel(final IRCChannelInfo channel) {
2097
 		synchronized (hChannelList) {
2094
 		synchronized (hChannelList) {
2098
 			hChannelList.remove(getIRCStringConverter().toLowerCase(channel.getName()));
2095
 			hChannelList.remove(getIRCStringConverter().toLowerCase(channel.getName()));
2099
 		}
2096
 		}
2115
 	 *
2112
 	 *
2116
 	 * @return Known channels as a collection
2113
 	 * @return Known channels as a collection
2117
 	 */
2114
 	 */
2118
-	public Collection<ChannelInfo> getChannels() {
2115
+	public Collection<IRCChannelInfo> getChannels() {
2119
 		synchronized (hChannelList) {
2116
 		synchronized (hChannelList) {
2120
 			return hChannelList.values();
2117
 			return hChannelList.values();
2121
 		}
2118
 		}

+ 4
- 3
src/com/dmdirc/parser/irc/IRCProcessor.java View File

22
 
22
 
23
 package com.dmdirc.parser.irc;
23
 package com.dmdirc.parser.irc;
24
 
24
 
25
+import com.dmdirc.parser.interfaces.ChannelInfo;
25
 import com.dmdirc.parser.irc.callbacks.CallbackManager;
26
 import com.dmdirc.parser.irc.callbacks.CallbackManager;
26
 
27
 
27
 /**
28
 /**
109
 	/**
110
 	/**
110
 	 * Get the ChannelInfo object for a channel.
111
 	 * Get the ChannelInfo object for a channel.
111
 	 *
112
 	 *
112
-	 * @param sWhat This is the name of the channel.
113
+	 * @param name This is the name of the channel.
113
 	 * @return ChannelInfo Object for the channel, or null
114
 	 * @return ChannelInfo Object for the channel, or null
114
 	 */
115
 	 */
115
-	protected final ChannelInfo getChannelInfo(final String sWhat) {
116
-		return myParser.getChannelInfo(sWhat);
116
+	protected final ChannelInfo getChannel(final String name) {
117
+		return myParser.getChannel(name);
117
 	}
118
 	}
118
 	
119
 	
119
 	/**
120
 	/**

+ 6
- 6
src/com/dmdirc/parser/irc/ProcessJoin.java View File

40
 	public void process(final String sParam, final String[] token) {
40
 	public void process(final String sParam, final String[] token) {
41
 		if (sParam.equals("329")) {
41
 		if (sParam.equals("329")) {
42
 			if (token.length < 5) { return; }
42
 			if (token.length < 5) { return; }
43
-			ChannelInfo iChannel = myParser.getChannelInfo(token[3]);
43
+			IRCChannelInfo iChannel = myParser.getChannel(token[3]);
44
 			if (iChannel != null) {
44
 			if (iChannel != null) {
45
 				try {
45
 				try {
46
 					iChannel.setCreateTime(Integer.parseInt(token[4]));
46
 					iChannel.setCreateTime(Integer.parseInt(token[4]));
51
 			Byte nTemp;
51
 			Byte nTemp;
52
 			if (token.length < 3) { return; }
52
 			if (token.length < 3) { return; }
53
 			ClientInfo iClient;
53
 			ClientInfo iClient;
54
-			ChannelInfo iChannel;
54
+			IRCChannelInfo iChannel;
55
 			ChannelClientInfo iChannelClient;
55
 			ChannelClientInfo iChannelClient;
56
 			
56
 			
57
 			iClient = myParser.getClientInfo(token[0]);
57
 			iClient = myParser.getClientInfo(token[0]);
58
-			iChannel = myParser.getChannelInfo(token[token.length-1]);
58
+			iChannel = myParser.getChannel(token[token.length-1]);
59
 			
59
 			
60
 			if (iClient == null) { 
60
 			if (iClient == null) { 
61
 				iClient = new ClientInfo(myParser, token[0]);
61
 				iClient = new ClientInfo(myParser, token[0]);
89
 			//if (iClient != myParser.getMyself()) {
89
 			//if (iClient != myParser.getMyself()) {
90
 				// callErrorInfo(new ParserError(ParserError.ERROR_WARNING, "Got join for channel ("+token[token.length-1]+") that I am not on. [Me: "+myParser.getMyself()+"]", myParser.getLastLine()));
90
 				// callErrorInfo(new ParserError(ParserError.ERROR_WARNING, "Got join for channel ("+token[token.length-1]+") that I am not on. [Me: "+myParser.getMyself()+"]", myParser.getLastLine()));
91
 			//}
91
 			//}
92
-			iChannel = new ChannelInfo(myParser, token[token.length-1]);
92
+			iChannel = new IRCChannelInfo(myParser, token[token.length-1]);
93
 			// Add ourself to the channel, this will be overridden by the NAMES reply
93
 			// Add ourself to the channel, this will be overridden by the NAMES reply
94
 			iChannel.addClient(iClient);
94
 			iChannel.addClient(iClient);
95
 			myParser.addChannel(iChannel);
95
 			myParser.addChannel(iChannel);
108
 	 * @param cChannelClient ChannelClient object for new person
108
 	 * @param cChannelClient ChannelClient object for new person
109
 	 * @return true if a method was called, false otherwise
109
 	 * @return true if a method was called, false otherwise
110
 	 */
110
 	 */
111
-	protected boolean callChannelJoin(final ChannelInfo cChannel, final ChannelClientInfo cChannelClient) {
111
+	protected boolean callChannelJoin(final IRCChannelInfo cChannel, final ChannelClientInfo cChannelClient) {
112
 		return getCallbackManager().getCallbackType(ChannelJoinListener.class).call(cChannel, cChannelClient);
112
 		return getCallbackManager().getCallbackType(ChannelJoinListener.class).call(cChannel, cChannelClient);
113
 	}
113
 	}
114
 	
114
 	
119
 	 * @param cChannel Channel Object
119
 	 * @param cChannel Channel Object
120
 	 * @return true if a method was called, false otherwise
120
 	 * @return true if a method was called, false otherwise
121
 	 */
121
 	 */
122
-	protected boolean callChannelSelfJoin(final ChannelInfo cChannel) {
122
+	protected boolean callChannelSelfJoin(final IRCChannelInfo cChannel) {
123
 		return  getCallbackManager().getCallbackType(ChannelSelfJoinListener.class).call(cChannel);
123
 		return  getCallbackManager().getCallbackType(ChannelSelfJoinListener.class).call(cChannel);
124
 	}
124
 	}
125
 	
125
 	

+ 3
- 2
src/com/dmdirc/parser/irc/ProcessKick.java View File

22
 
22
 
23
 package com.dmdirc.parser.irc;
23
 package com.dmdirc.parser.irc;
24
 
24
 
25
+import com.dmdirc.parser.interfaces.ChannelInfo;
25
 import com.dmdirc.parser.interfaces.callbacks.ChannelKickListener;
26
 import com.dmdirc.parser.interfaces.callbacks.ChannelKickListener;
26
 
27
 
27
 /**
28
 /**
46
 		
47
 		
47
 		iClient = getClientInfo(token[3]);
48
 		iClient = getClientInfo(token[3]);
48
 		iKicker = getClientInfo(token[0]);
49
 		iKicker = getClientInfo(token[0]);
49
-		iChannel = getChannelInfo(token[2]);
50
+		iChannel = getChannel(token[2]);
50
 		
51
 		
51
 		if (iClient == null) { return; }
52
 		if (iClient == null) { return; }
52
 		
53
 		
89
 	 * @param sKickedByHost Hostname of Kicker (or servername)
90
 	 * @param sKickedByHost Hostname of Kicker (or servername)
90
 	 * @return true if a method was called, false otherwise
91
 	 * @return true if a method was called, false otherwise
91
 	 */
92
 	 */
92
-	protected boolean callChannelKick(ChannelInfo cChannel, ChannelClientInfo cKickedClient, ChannelClientInfo cKickedByClient, String sReason, String sKickedByHost) {
93
+	protected boolean callChannelKick(IRCChannelInfo cChannel, ChannelClientInfo cKickedClient, ChannelClientInfo cKickedByClient, String sReason, String sKickedByHost) {
93
 		return getCallbackManager().getCallbackType(ChannelKickListener.class).call(cChannel, cKickedClient, cKickedByClient, sReason, sKickedByHost);
94
 		return getCallbackManager().getCallbackType(ChannelKickListener.class).call(cChannel, cKickedClient, cKickedByClient, sReason, sKickedByHost);
94
 	}
95
 	}
95
 	
96
 	

+ 3
- 2
src/com/dmdirc/parser/irc/ProcessListModes.java View File

22
 
22
 
23
 package com.dmdirc.parser.irc;
23
 package com.dmdirc.parser.irc;
24
 
24
 
25
+import com.dmdirc.parser.interfaces.ChannelInfo;
25
 import com.dmdirc.parser.interfaces.callbacks.ChannelListModeListener;
26
 import com.dmdirc.parser.interfaces.callbacks.ChannelListModeListener;
26
 import java.util.List;
27
 import java.util.List;
27
 import java.util.LinkedList;
28
 import java.util.LinkedList;
40
 	@SuppressWarnings("unchecked")
41
 	@SuppressWarnings("unchecked")
41
 	@Override
42
 	@Override
42
 	public void process(String sParam, String[] token) {
43
 	public void process(String sParam, String[] token) {
43
-		ChannelInfo channel = getChannelInfo(token[3]);
44
+		ChannelInfo channel = getChannel(token[3]);
44
 		String thisIRCD = myParser.getIRCD(true).toLowerCase();
45
 		String thisIRCD = myParser.getIRCD(true).toLowerCase();
45
 		String item = "";
46
 		String item = "";
46
 		String owner = "";
47
 		String owner = "";
227
 	 * @param cChannel Channel which the ListModes reply is for
228
 	 * @param cChannel Channel which the ListModes reply is for
228
 	 * @return true if a method was called, false otherwise
229
 	 * @return true if a method was called, false otherwise
229
 	 */
230
 	 */
230
-	protected boolean callChannelGotListModes(ChannelInfo cChannel) {
231
+	protected boolean callChannelGotListModes(IRCChannelInfo cChannel) {
231
 		return getCallbackManager().getCallbackType(ChannelListModeListener.class).call(cChannel);
232
 		return getCallbackManager().getCallbackType(ChannelListModeListener.class).call(cChannel);
232
 	}
233
 	}
233
 	
234
 	

+ 9
- 8
src/com/dmdirc/parser/irc/ProcessMessage.java View File

22
 
22
 
23
 package com.dmdirc.parser.irc;
23
 package com.dmdirc.parser.irc;
24
 
24
 
25
+import com.dmdirc.parser.interfaces.ChannelInfo;
25
 import com.dmdirc.parser.interfaces.callbacks.ChannelActionListener;
26
 import com.dmdirc.parser.interfaces.callbacks.ChannelActionListener;
26
 import com.dmdirc.parser.interfaces.callbacks.ChannelCtcpListener;
27
 import com.dmdirc.parser.interfaces.callbacks.ChannelCtcpListener;
27
 import com.dmdirc.parser.interfaces.callbacks.ChannelCtcpReplyListener;
28
 import com.dmdirc.parser.interfaces.callbacks.ChannelCtcpReplyListener;
161
 		final String targetName = (hasModePrefix) ? token[2].substring(1) : token[2];
162
 		final String targetName = (hasModePrefix) ? token[2].substring(1) : token[2];
162
 		
163
 		
163
 		if (isValidChannelName(targetName)) {
164
 		if (isValidChannelName(targetName)) {
164
-			iChannel = getChannelInfo(targetName);
165
+			iChannel = getChannel(targetName);
165
 			if (iChannel == null) {
166
 			if (iChannel == null) {
166
 				// callErrorInfo(new ParserError(ParserError.ERROR_WARNING, "Got message for channel ("+targetName+") that I am not on.", myParser.getLastLine()));
167
 				// callErrorInfo(new ParserError(ParserError.ERROR_WARNING, "Got message for channel ("+targetName+") that I am not on.", myParser.getLastLine()));
167
 				return;
168
 				return;
238
 	 * @param sHost Hostname of sender (or servername)
239
 	 * @param sHost Hostname of sender (or servername)
239
 	 * @return true if a method was called, false otherwise
240
 	 * @return true if a method was called, false otherwise
240
 	 */
241
 	 */
241
-	protected boolean callChannelAction(final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sMessage, final String sHost) {
242
+	protected boolean callChannelAction(final IRCChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sMessage, final String sHost) {
242
 		return getCallbackManager().getCallbackType(ChannelActionListener.class).call(cChannel, cChannelClient, sMessage, sHost);
243
 		return getCallbackManager().getCallbackType(ChannelActionListener.class).call(cChannel, cChannelClient, sMessage, sHost);
243
 	}
244
 	}
244
 	
245
 	
253
 	 * @param sHost Hostname of sender (or servername)
254
 	 * @param sHost Hostname of sender (or servername)
254
 	 * @return true if a method was called, false otherwise
255
 	 * @return true if a method was called, false otherwise
255
 	 */
256
 	 */
256
-	protected boolean callChannelCTCP(final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sType, final String sMessage, final String sHost) {
257
+	protected boolean callChannelCTCP(final IRCChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sType, final String sMessage, final String sHost) {
257
 		return getCallbackManager().getCallbackType(ChannelCtcpListener.class).call(cChannel, cChannelClient, sType, sMessage, sHost);
258
 		return getCallbackManager().getCallbackType(ChannelCtcpListener.class).call(cChannel, cChannelClient, sType, sMessage, sHost);
258
 	}
259
 	}
259
 
260
 
268
 	 * @param sHost Hostname of sender (or servername)
269
 	 * @param sHost Hostname of sender (or servername)
269
 	 * @return true if a method was called, false otherwise
270
 	 * @return true if a method was called, false otherwise
270
 	 */
271
 	 */
271
-	protected boolean callChannelCTCPReply(final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sType, final String sMessage, final String sHost) {
272
+	protected boolean callChannelCTCPReply(final IRCChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sType, final String sMessage, final String sHost) {
272
 		return getCallbackManager().getCallbackType(ChannelCtcpReplyListener.class).call(cChannel, cChannelClient, sType, sMessage, sHost);
273
 		return getCallbackManager().getCallbackType(ChannelCtcpReplyListener.class).call(cChannel, cChannelClient, sType, sMessage, sHost);
273
 	}
274
 	}
274
 	
275
 	
282
 	 * @param sHost Hostname of sender (or servername)
283
 	 * @param sHost Hostname of sender (or servername)
283
 	 * @return true if a method was called, false otherwise
284
 	 * @return true if a method was called, false otherwise
284
 	 */
285
 	 */
285
-	protected boolean callChannelMessage(final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sMessage, final String sHost) {
286
+	protected boolean callChannelMessage(final IRCChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sMessage, final String sHost) {
286
 		return getCallbackManager().getCallbackType(ChannelMessageListener.class).call(cChannel, cChannelClient, sMessage, sHost);
287
 		return getCallbackManager().getCallbackType(ChannelMessageListener.class).call(cChannel, cChannelClient, sMessage, sHost);
287
 	}
288
 	}
288
 	
289
 	
296
 	 * @param sHost Hostname of sender (or servername)
297
 	 * @param sHost Hostname of sender (or servername)
297
 	 * @return true if a method was called, false otherwise
298
 	 * @return true if a method was called, false otherwise
298
 	 */
299
 	 */
299
-	protected boolean callChannelNotice(final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sMessage, final String sHost) {
300
+	protected boolean callChannelNotice(final IRCChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sMessage, final String sHost) {
300
 		return getCallbackManager().getCallbackType(ChannelNoticeListener.class).call(cChannel, cChannelClient, sMessage, sHost);
301
 		return getCallbackManager().getCallbackType(ChannelNoticeListener.class).call(cChannel, cChannelClient, sMessage, sHost);
301
 	}
302
 	}
302
 	
303
 	
311
 	 * @param sHost Hostname of sender (or servername)
312
 	 * @param sHost Hostname of sender (or servername)
312
 	 * @return true if a method was called, false otherwise
313
 	 * @return true if a method was called, false otherwise
313
 	 */
314
 	 */
314
-	protected boolean callChannelModeNotice(final char prefix, final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sMessage, final String sHost) {
315
+	protected boolean callChannelModeNotice(final char prefix, final IRCChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sMessage, final String sHost) {
315
 		return getCallbackManager().getCallbackType(ChannelModeNoticeListener.class).call(prefix, cChannel, cChannelClient, sMessage, sHost);
316
 		return getCallbackManager().getCallbackType(ChannelModeNoticeListener.class).call(prefix, cChannel, cChannelClient, sMessage, sHost);
316
 	}
317
 	}
317
 	
318
 	
326
 	 * @param sHost Hostname of sender (or servername)
327
 	 * @param sHost Hostname of sender (or servername)
327
 	 * @return true if a method was called, false otherwise
328
 	 * @return true if a method was called, false otherwise
328
 	 */
329
 	 */
329
-	protected boolean callChannelModeMessage(final char prefix, final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sMessage, final String sHost) {
330
+	protected boolean callChannelModeMessage(final char prefix, final IRCChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sMessage, final String sHost) {
330
 		return getCallbackManager().getCallbackType(ChannelModeMessageListener.class).call(prefix, cChannel, cChannelClient, sMessage, sHost);
331
 		return getCallbackManager().getCallbackType(ChannelModeMessageListener.class).call(prefix, cChannel, cChannelClient, sMessage, sHost);
331
 	}
332
 	}
332
 	
333
 	

+ 4
- 3
src/com/dmdirc/parser/irc/ProcessMode.java View File

22
 
22
 
23
 package com.dmdirc.parser.irc;
23
 package com.dmdirc.parser.irc;
24
 
24
 
25
+import com.dmdirc.parser.interfaces.ChannelInfo;
25
 import com.dmdirc.parser.interfaces.callbacks.ChannelModeChangeListener;
26
 import com.dmdirc.parser.interfaces.callbacks.ChannelModeChangeListener;
26
 import com.dmdirc.parser.interfaces.callbacks.ChannelNonUserModeChangeListener;
27
 import com.dmdirc.parser.interfaces.callbacks.ChannelNonUserModeChangeListener;
27
 import com.dmdirc.parser.interfaces.callbacks.ChannelSingleModeChangeListener;
28
 import com.dmdirc.parser.interfaces.callbacks.ChannelSingleModeChangeListener;
101
 			cbNonUser = getCallbackManager().getCallbackType(ChannelNonUserModeChangeListener.class);
102
 			cbNonUser = getCallbackManager().getCallbackType(ChannelNonUserModeChangeListener.class);
102
 		}
103
 		}
103
 		
104
 		
104
-		iChannel = getChannelInfo(sChannelName);
105
+		iChannel = getChannel(sChannelName);
105
 		if (iChannel == null) { 
106
 		if (iChannel == null) { 
106
 			// callErrorInfo(new ParserError(ParserError.ERROR_WARNING, "Got modes for channel ("+sChannelName+") that I am not on.", myParser.getLastLine()));
107
 			// callErrorInfo(new ParserError(ParserError.ERROR_WARNING, "Got modes for channel ("+sChannelName+") that I am not on.", myParser.getLastLine()));
107
 			// iChannel = new ChannelInfo(myParser, sChannelName);
108
 			// iChannel = new ChannelInfo(myParser, sChannelName);
279
 	 * @param sModes Exact String parsed
280
 	 * @param sModes Exact String parsed
280
 	 * @return true if a method was called, false otherwise
281
 	 * @return true if a method was called, false otherwise
281
 	 */
282
 	 */
282
-	protected boolean callChannelModeChanged(ChannelInfo cChannel, ChannelClientInfo cChannelClient, String sHost, String sModes) {
283
+	protected boolean callChannelModeChanged(IRCChannelInfo cChannel, ChannelClientInfo cChannelClient, String sHost, String sModes) {
283
 		return getCallbackManager().getCallbackType(ChannelModeChangeListener.class).call(cChannel, cChannelClient, sHost, sModes);
284
 		return getCallbackManager().getCallbackType(ChannelModeChangeListener.class).call(cChannel, cChannelClient, sHost, sModes);
284
 	}
285
 	}
285
 	
286
 	
294
 	 * @param sHost Host doing the mode changing (User host or server name)
295
 	 * @param sHost Host doing the mode changing (User host or server name)
295
 	 * @return true if a method was called, false otherwise
296
 	 * @return true if a method was called, false otherwise
296
 	 */
297
 	 */
297
-	protected boolean callChannelUserModeChanged(ChannelInfo cChannel, ChannelClientInfo cChangedClient, ChannelClientInfo cSetByClient, String sHost, String sMode) {
298
+	protected boolean callChannelUserModeChanged(IRCChannelInfo cChannel, ChannelClientInfo cChangedClient, ChannelClientInfo cSetByClient, String sHost, String sMode) {
298
 		return getCallbackManager().getCallbackType(ChannelUserModeChangeListener.class).call(cChannel, cChangedClient, cSetByClient, sHost, sMode);
299
 		return getCallbackManager().getCallbackType(ChannelUserModeChangeListener.class).call(cChannel, cChangedClient, cSetByClient, sHost, sMode);
299
 	}
300
 	}
300
 	
301
 	

+ 4
- 3
src/com/dmdirc/parser/irc/ProcessNames.java View File

22
 
22
 
23
 package com.dmdirc.parser.irc;
23
 package com.dmdirc.parser.irc;
24
 
24
 
25
+import com.dmdirc.parser.interfaces.ChannelInfo;
25
 import com.dmdirc.parser.interfaces.callbacks.ChannelNamesListener;
26
 import com.dmdirc.parser.interfaces.callbacks.ChannelNamesListener;
26
 
27
 
27
 /**
28
 /**
39
 		ChannelInfo iChannel;
40
 		ChannelInfo iChannel;
40
 		if (sParam.equals("366")) {
41
 		if (sParam.equals("366")) {
41
 			// End of names
42
 			// End of names
42
-			iChannel = getChannelInfo(token[3]);
43
+			iChannel = getChannel(token[3]);
43
 			if (iChannel == null) { return; }
44
 			if (iChannel == null) { return; }
44
 			
45
 			
45
 			iChannel.setAddingNames(false);
46
 			iChannel.setAddingNames(false);
56
 			ClientInfo iClient;
57
 			ClientInfo iClient;
57
 			ChannelClientInfo iChannelClient;
58
 			ChannelClientInfo iChannelClient;
58
 			
59
 			
59
-			iChannel = getChannelInfo(token[4]);
60
+			iChannel = getChannel(token[4]);
60
 		
61
 		
61
 			if (iChannel == null) { return; }
62
 			if (iChannel == null) { return; }
62
 			
63
 			
107
 	 * @param cChannel Channel which the names reply is for
108
 	 * @param cChannel Channel which the names reply is for
108
 	 * @return true if a method was called, false otherwise
109
 	 * @return true if a method was called, false otherwise
109
 	 */
110
 	 */
110
-	protected boolean callChannelGotNames(ChannelInfo cChannel) {
111
+	protected boolean callChannelGotNames(IRCChannelInfo cChannel) {
111
 		return getCallbackManager().getCallbackType(ChannelNamesListener.class).call(cChannel);
112
 		return getCallbackManager().getCallbackType(ChannelNamesListener.class).call(cChannel);
112
 	}
113
 	}
113
 	
114
 	

+ 2
- 2
src/com/dmdirc/parser/irc/ProcessNick.java View File

61
 					myParser.addClient(iClient);
61
 					myParser.addClient(iClient);
62
 				}
62
 				}
63
 				
63
 				
64
-				for (ChannelInfo iChannel : myParser.getChannels()) {
64
+				for (IRCChannelInfo iChannel : myParser.getChannels()) {
65
 					// Find the user (using the old nickname)
65
 					// Find the user (using the old nickname)
66
 					iChannelClient = iChannel.getUser(oldNickname);
66
 					iChannelClient = iChannel.getUser(oldNickname);
67
 					if (iChannelClient != null) {
67
 					if (iChannelClient != null) {
90
 	 * @param sOldNick Nickname before change
90
 	 * @param sOldNick Nickname before change
91
 	 * @return true if a method was called, false otherwise
91
 	 * @return true if a method was called, false otherwise
92
 	 */
92
 	 */
93
-	protected boolean callChannelNickChanged(ChannelInfo cChannel, ChannelClientInfo cChannelClient, String sOldNick) {
93
+	protected boolean callChannelNickChanged(IRCChannelInfo cChannel, ChannelClientInfo cChannelClient, String sOldNick) {
94
 		return getCallbackManager().getCallbackType(ChannelNickChangeListener.class).call(cChannel, cChannelClient, sOldNick);
94
 		return getCallbackManager().getCallbackType(ChannelNickChangeListener.class).call(cChannel, cChannelClient, sOldNick);
95
 	}
95
 	}
96
 	
96
 	

+ 3
- 2
src/com/dmdirc/parser/irc/ProcessPart.java View File

22
 
22
 
23
 package com.dmdirc.parser.irc;
23
 package com.dmdirc.parser.irc;
24
 
24
 
25
+import com.dmdirc.parser.interfaces.ChannelInfo;
25
 import com.dmdirc.parser.interfaces.callbacks.ChannelPartListener;
26
 import com.dmdirc.parser.interfaces.callbacks.ChannelPartListener;
26
 
27
 
27
 /**
28
 /**
45
 		ChannelClientInfo iChannelClient;
46
 		ChannelClientInfo iChannelClient;
46
 		
47
 		
47
 		iClient = getClientInfo(token[0]);
48
 		iClient = getClientInfo(token[0]);
48
-		iChannel = getChannelInfo(token[2]);
49
+		iChannel = getChannel(token[2]);
49
 		
50
 		
50
 		if (iClient == null) { return; }
51
 		if (iClient == null) { return; }
51
 		if (IRCParser.ALWAYS_UPDATECLIENT && iClient.getHost().isEmpty()) {
52
 		if (IRCParser.ALWAYS_UPDATECLIENT && iClient.getHost().isEmpty()) {
85
 	 * @param sReason Reason given for parting (May be "")
86
 	 * @param sReason Reason given for parting (May be "")
86
 	 * @return true if a method was called, false otherwise
87
 	 * @return true if a method was called, false otherwise
87
 	 */
88
 	 */
88
-	protected boolean callChannelPart(final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sReason) {
89
+	protected boolean callChannelPart(final IRCChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sReason) {
89
 		return getCallbackManager().getCallbackType(ChannelPartListener.class).call(cChannel, cChannelClient, sReason);
90
 		return getCallbackManager().getCallbackType(ChannelPartListener.class).call(cChannel, cChannelClient, sReason);
90
 	}
91
 	}
91
 	
92
 	

+ 3
- 3
src/com/dmdirc/parser/irc/ProcessQuit.java View File

55
 		String sReason = "";
55
 		String sReason = "";
56
 		if (token.length > 2) { sReason = token[token.length-1]; }
56
 		if (token.length > 2) { sReason = token[token.length-1]; }
57
 		
57
 		
58
-		ArrayList<ChannelInfo> channelList = new ArrayList<ChannelInfo>(myParser.getChannels());
59
-		for (ChannelInfo iChannel : channelList) {
58
+		ArrayList<IRCChannelInfo> channelList = new ArrayList<IRCChannelInfo>(myParser.getChannels());
59
+		for (IRCChannelInfo iChannel : channelList) {
60
 			iChannelClient = iChannel.getUser(iClient);
60
 			iChannelClient = iChannel.getUser(iClient);
61
 			if (iChannelClient != null) {
61
 			if (iChannelClient != null) {
62
 				if (myParser.removeAfterCallback) { callChannelQuit(iChannel,iChannelClient,sReason); }
62
 				if (myParser.removeAfterCallback) { callChannelQuit(iChannel,iChannelClient,sReason); }
88
 	 * @param sReason Quit reason
88
 	 * @param sReason Quit reason
89
 	 * @return true if a method was called, false otherwise
89
 	 * @return true if a method was called, false otherwise
90
 	 */
90
 	 */
91
-	protected boolean callChannelQuit(final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sReason) {
91
+	protected boolean callChannelQuit(final IRCChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sReason) {
92
 		return getCallbackManager().getCallbackType(ChannelQuitListener.class).call(cChannel, cChannelClient, sReason);
92
 		return getCallbackManager().getCallbackType(ChannelQuitListener.class).call(cChannel, cChannelClient, sReason);
93
 	}
93
 	}
94
 	
94
 	

+ 4
- 3
src/com/dmdirc/parser/irc/ProcessTopic.java View File

22
 
22
 
23
 package com.dmdirc.parser.irc;
23
 package com.dmdirc.parser.irc;
24
 
24
 
25
+import com.dmdirc.parser.interfaces.ChannelInfo;
25
 import com.dmdirc.parser.interfaces.callbacks.ChannelTopicListener;
26
 import com.dmdirc.parser.interfaces.callbacks.ChannelTopicListener;
26
 
27
 
27
 /**
28
 /**
38
 	public void process(final String sParam, final String[] token) {
39
 	public void process(final String sParam, final String[] token) {
39
 		ChannelInfo iChannel;
40
 		ChannelInfo iChannel;
40
 		if (sParam.equals("332")) {
41
 		if (sParam.equals("332")) {
41
-			iChannel = getChannelInfo(token[3]);
42
+			iChannel = getChannel(token[3]);
42
 			if (iChannel == null) { return; }
43
 			if (iChannel == null) { return; }
43
 			iChannel.setTopic(token[token.length-1]);
44
 			iChannel.setTopic(token[token.length-1]);
44
 		} else if (sParam.equals("333")) {
45
 		} else if (sParam.equals("333")) {
45
 			if (token.length > 3) {
46
 			if (token.length > 3) {
46
-				iChannel = getChannelInfo(token[3]);
47
+				iChannel = getChannel(token[3]);
47
 				if (iChannel == null) { return; }
48
 				if (iChannel == null) { return; }
48
 				if (token.length > 4) {
49
 				if (token.length > 4) {
49
 					iChannel.setTopicUser(token[4]);
50
 					iChannel.setTopicUser(token[4]);
58
 				final ClientInfo iClient = getClientInfo(token[0]);
59
 				final ClientInfo iClient = getClientInfo(token[0]);
59
 				if (iClient != null && iClient.getHost().isEmpty()) {iClient.setUserBits(token[0],false); }
60
 				if (iClient != null && iClient.getHost().isEmpty()) {iClient.setUserBits(token[0],false); }
60
 			}
61
 			}
61
-			iChannel = getChannelInfo(token[2]);
62
+			iChannel = getChannel(token[2]);
62
 			if (iChannel == null) { return; }
63
 			if (iChannel == null) { return; }
63
 			iChannel.setTopicTime(System.currentTimeMillis() / 1000);
64
 			iChannel.setTopicTime(System.currentTimeMillis() / 1000);
64
 			if (token[0].charAt(0) == ':') { token[0] = token[0].substring(1); }
65
 			if (token[0].charAt(0) == ':') { token[0] = token[0].substring(1); }

+ 2
- 6
src/com/dmdirc/parser/irc/ProcessWho.java View File

47
 		// :server 352 mynickname channel username address server nick flags :hops info
47
 		// :server 352 mynickname channel username address server nick flags :hops info
48
 		//     0    1      2         3     4          5      6      7    8        9
48
 		//     0    1      2         3     4          5      6      7    8        9
49
 		
49
 		
50
-//		ChannelInfo channel = myParser.getChannelInfo(token[3]);
51
-//		ChannelClientInfo channelClient = channel.getUser(token[7]);
52
-//		ClientInfo client = channelClient.getClient();
53
 		final ClientInfo client = myParser.getClientInfo(token[7]);
50
 		final ClientInfo client = myParser.getClientInfo(token[7]);
54
 		if (client != null) {
51
 		if (client != null) {
55
 			// Update ident/host
52
 			// Update ident/host
63
 			final String mode = token[8];
60
 			final String mode = token[8];
64
 			final boolean isAway = mode.indexOf('G') != -1;
61
 			final boolean isAway = mode.indexOf('G') != -1;
65
 			if (client.getAwayState() != isAway) {
62
 			if (client.getAwayState() != isAway) {
66
-//				System.out.println("Away state for '"+client+"' changed to: "+isAway);
67
 				client.setAwayState(isAway);
63
 				client.setAwayState(isAway);
68
 				if (!isAway) { client.setAwayReason(""); }
64
 				if (!isAway) { client.setAwayReason(""); }
69
 				if (client == myParser.getMyself()) {
65
 				if (client == myParser.getMyself()) {
72
 					callAwayStateOther(client, isAway);
68
 					callAwayStateOther(client, isAway);
73
 					
69
 					
74
 					ChannelClientInfo iChannelClient;
70
 					ChannelClientInfo iChannelClient;
75
-					for (ChannelInfo iChannel : myParser.getChannels()) {
71
+					for (IRCChannelInfo iChannel : myParser.getChannels()) {
76
 						iChannelClient = iChannel.getUser(client);
72
 						iChannelClient = iChannel.getUser(client);
77
 						if (iChannelClient != null) {
73
 						if (iChannelClient != null) {
78
 							callChannelAwayStateOther(iChannel,iChannelClient,isAway);
74
 							callChannelAwayStateOther(iChannel,iChannelClient,isAway);
116
 	 * @param state Away State (true if away, false if here)
112
 	 * @param state Away State (true if away, false if here)
117
 	 * @return true if a method was called, false otherwise
113
 	 * @return true if a method was called, false otherwise
118
 	 */
114
 	 */
119
-	protected boolean callChannelAwayStateOther(final ChannelInfo channel, final ChannelClientInfo channelClient, final boolean state) {
115
+	protected boolean callChannelAwayStateOther(final IRCChannelInfo channel, final ChannelClientInfo channelClient, final boolean state) {
120
 		return getCallbackManager().getCallbackType(ChannelOtherAwayStateListener.class).call(channel, channelClient, state);
116
 		return getCallbackManager().getCallbackType(ChannelOtherAwayStateListener.class).call(channel, channelClient, state);
121
 	}
117
 	}
122
 	
118
 	

+ 5
- 5
src/com/dmdirc/parser/irc/callbacks/CallbackObjectSpecific.java View File

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

+ 2
- 2
test/com/dmdirc/addons/logging/LoggingPluginTest.java View File

30
 import com.dmdirc.config.IdentityManager;
30
 import com.dmdirc.config.IdentityManager;
31
 import com.dmdirc.harness.TestLoggingPlugin;
31
 import com.dmdirc.harness.TestLoggingPlugin;
32
 import com.dmdirc.harness.parser.TestParserFactory;
32
 import com.dmdirc.harness.parser.TestParserFactory;
33
-import com.dmdirc.parser.irc.ChannelInfo;
33
+import com.dmdirc.parser.irc.IRCChannelInfo;
34
 import com.dmdirc.addons.ui_dummy.DummyController;
34
 import com.dmdirc.addons.ui_dummy.DummyController;
35
 import com.dmdirc.plugins.PluginInfo;
35
 import com.dmdirc.plugins.PluginInfo;
36
 import com.dmdirc.util.ConfigFile;
36
 import com.dmdirc.util.ConfigFile;
54
         server = new Server("255.255.255.255", 6667, "", false,
54
         server = new Server("255.255.255.255", 6667, "", false,
55
                 IdentityManager.getProfiles().get(0), new ArrayList<String>(),
55
                 IdentityManager.getProfiles().get(0), new ArrayList<String>(),
56
                 new TestParserFactory());
56
                 new TestParserFactory());
57
-        channel = new Channel(server, new ChannelInfo(server.getParser(), "#test"));
57
+        channel = new Channel(server, new IRCChannelInfo(server.getParser(), "#test"));
58
         query = new Query(server, "foo!bar@baz");
58
         query = new Query(server, "foo!bar@baz");
59
 
59
 
60
         final ConfigFile file = new ConfigFile(LoggingPlugin.class
60
         final ConfigFile file = new ConfigFile(LoggingPlugin.class

+ 4
- 4
test/com/dmdirc/commandparser/commands/channel/KickReasonTest.java View File

27
 import com.dmdirc.commandparser.CommandArguments;
27
 import com.dmdirc.commandparser.CommandArguments;
28
 import com.dmdirc.config.ConfigManager;
28
 import com.dmdirc.config.ConfigManager;
29
 import com.dmdirc.parser.irc.ChannelClientInfo;
29
 import com.dmdirc.parser.irc.ChannelClientInfo;
30
-import com.dmdirc.parser.irc.ChannelInfo;
30
+import com.dmdirc.parser.irc.IRCChannelInfo;
31
 import com.dmdirc.ui.interfaces.InputWindow;
31
 import com.dmdirc.ui.interfaces.InputWindow;
32
 
32
 
33
 import org.junit.BeforeClass;
33
 import org.junit.BeforeClass;
54
     @Test
54
     @Test
55
     public void testUnknown() {
55
     public void testUnknown() {
56
         final InputWindow tiw = mock(InputWindow.class);
56
         final InputWindow tiw = mock(InputWindow.class);
57
-        final ChannelInfo channelInfo = mock(ChannelInfo.class);
57
+        final IRCChannelInfo channelInfo = mock(IRCChannelInfo.class);
58
         final Channel channel = mock(Channel.class);
58
         final Channel channel = mock(Channel.class);
59
 
59
 
60
         when(channel.getChannelInfo()).thenReturn(channelInfo);
60
         when(channel.getChannelInfo()).thenReturn(channelInfo);
68
     @Test
68
     @Test
69
     public void testWithReason() {
69
     public void testWithReason() {
70
         final InputWindow tiw = mock(InputWindow.class);
70
         final InputWindow tiw = mock(InputWindow.class);
71
-        final ChannelInfo channelInfo = mock(ChannelInfo.class);
71
+        final IRCChannelInfo channelInfo = mock(IRCChannelInfo.class);
72
         final Channel channel = mock(Channel.class);
72
         final Channel channel = mock(Channel.class);
73
         final ChannelClientInfo cci = mock(ChannelClientInfo.class);
73
         final ChannelClientInfo cci = mock(ChannelClientInfo.class);
74
 
74
 
84
     public void testWithoutReason() {
84
     public void testWithoutReason() {
85
         final InputWindow tiw = mock(InputWindow.class);
85
         final InputWindow tiw = mock(InputWindow.class);
86
         final ConfigManager manager = mock(ConfigManager.class);
86
         final ConfigManager manager = mock(ConfigManager.class);
87
-        final ChannelInfo channelInfo = mock(ChannelInfo.class);
87
+        final IRCChannelInfo channelInfo = mock(IRCChannelInfo.class);
88
         final Channel channel = mock(Channel.class);
88
         final Channel channel = mock(Channel.class);
89
         final ChannelClientInfo cci = mock(ChannelClientInfo.class);
89
         final ChannelClientInfo cci = mock(ChannelClientInfo.class);
90
 
90
 

+ 3
- 3
test/com/dmdirc/commandparser/commands/channel/ModeTest.java View File

26
 import com.dmdirc.Server;
26
 import com.dmdirc.Server;
27
 import com.dmdirc.commandparser.CommandArguments;
27
 import com.dmdirc.commandparser.CommandArguments;
28
 import com.dmdirc.config.IdentityManager;
28
 import com.dmdirc.config.IdentityManager;
29
-import com.dmdirc.parser.irc.ChannelInfo;
29
+import com.dmdirc.parser.irc.IRCChannelInfo;
30
 import com.dmdirc.parser.irc.IRCParser;
30
 import com.dmdirc.parser.irc.IRCParser;
31
 import com.dmdirc.ui.interfaces.InputWindow;
31
 import com.dmdirc.ui.interfaces.InputWindow;
32
 
32
 
38
 public class ModeTest {
38
 public class ModeTest {
39
 
39
 
40
     private final Mode command = new Mode();
40
     private final Mode command = new Mode();
41
-    private ChannelInfo channelinfo;
41
+    private IRCChannelInfo channelinfo;
42
     private Channel channel;
42
     private Channel channel;
43
     private Server server;
43
     private Server server;
44
     private IRCParser parser;
44
     private IRCParser parser;
55
         parser = mock(IRCParser.class);
55
         parser = mock(IRCParser.class);
56
         server = mock(Server.class);
56
         server = mock(Server.class);
57
         channel = mock(Channel.class);
57
         channel = mock(Channel.class);
58
-        channelinfo = mock(ChannelInfo.class);
58
+        channelinfo = mock(IRCChannelInfo.class);
59
 
59
 
60
         when(server.getParser()).thenReturn(parser);
60
         when(server.getParser()).thenReturn(parser);
61
         when(channel.getChannelInfo()).thenReturn(channelinfo);
61
         when(channel.getChannelInfo()).thenReturn(channelinfo);

+ 3
- 3
test/com/dmdirc/commandparser/commands/channel/NamesTest.java View File

26
 import com.dmdirc.Server;
26
 import com.dmdirc.Server;
27
 import com.dmdirc.commandparser.CommandArguments;
27
 import com.dmdirc.commandparser.CommandArguments;
28
 import com.dmdirc.config.IdentityManager;
28
 import com.dmdirc.config.IdentityManager;
29
-import com.dmdirc.parser.irc.ChannelInfo;
29
+import com.dmdirc.parser.irc.IRCChannelInfo;
30
 import com.dmdirc.parser.irc.IRCParser;
30
 import com.dmdirc.parser.irc.IRCParser;
31
 
31
 
32
 import org.junit.Before;
32
 import org.junit.Before;
37
 public class NamesTest {
37
 public class NamesTest {
38
 
38
 
39
     private final Names command = new Names();
39
     private final Names command = new Names();
40
-    private ChannelInfo channelinfo;
40
+    private IRCChannelInfo channelinfo;
41
     private Channel channel;
41
     private Channel channel;
42
     private Server server;
42
     private Server server;
43
     private IRCParser parser;
43
     private IRCParser parser;
54
         parser = mock(IRCParser.class);
54
         parser = mock(IRCParser.class);
55
         server = mock(Server.class);
55
         server = mock(Server.class);
56
         channel = mock(Channel.class);
56
         channel = mock(Channel.class);
57
-        channelinfo = mock(ChannelInfo.class);
57
+        channelinfo = mock(IRCChannelInfo.class);
58
 
58
 
59
         when(server.getParser()).thenReturn(parser);
59
         when(server.getParser()).thenReturn(parser);
60
         when(channel.getChannelInfo()).thenReturn(channelinfo);
60
         when(channel.getChannelInfo()).thenReturn(channelinfo);

+ 1
- 1
test/com/dmdirc/commandparser/commands/channel/PartTest.java View File

27
 import com.dmdirc.commandparser.CommandArguments;
27
 import com.dmdirc.commandparser.CommandArguments;
28
 import com.dmdirc.config.ConfigManager;
28
 import com.dmdirc.config.ConfigManager;
29
 import com.dmdirc.config.IdentityManager;
29
 import com.dmdirc.config.IdentityManager;
30
-import com.dmdirc.parser.irc.ChannelInfo;
30
+import com.dmdirc.parser.irc.IRCChannelInfo;
31
 import com.dmdirc.parser.irc.IRCParser;
31
 import com.dmdirc.parser.irc.IRCParser;
32
 import com.dmdirc.ui.interfaces.InputWindow;
32
 import com.dmdirc.ui.interfaces.InputWindow;
33
 
33
 

+ 2
- 2
test/com/dmdirc/harness/parser/TestIChannelPart.java View File

27
 
27
 
28
 public class TestIChannelPart implements ChannelPartListener {
28
 public class TestIChannelPart implements ChannelPartListener {
29
 
29
 
30
-    public ChannelInfo channel;
30
+    public IRCChannelInfo channel;
31
 
31
 
32
     public ChannelClientInfo cclient;
32
     public ChannelClientInfo cclient;
33
 
33
 
34
     public String reason;
34
     public String reason;
35
 
35
 
36
-    public void onChannelPart(IRCParser tParser, ChannelInfo cChannel,
36
+    public void onChannelPart(IRCParser tParser, IRCChannelInfo cChannel,
37
                               ChannelClientInfo cChannelClient, String sReason) {
37
                               ChannelClientInfo cChannelClient, String sReason) {
38
         channel = cChannel;
38
         channel = cChannel;
39
         cclient = cChannelClient;
39
         cclient = cChannelClient;

+ 2
- 2
test/com/dmdirc/harness/parser/TestIChannelSelfJoin.java View File

27
 
27
 
28
 public class TestIChannelSelfJoin implements ChannelSelfJoinListener {
28
 public class TestIChannelSelfJoin implements ChannelSelfJoinListener {
29
 
29
 
30
-    public ChannelInfo channel = null;
30
+    public IRCChannelInfo channel = null;
31
 
31
 
32
-    public void onChannelSelfJoin(IRCParser tParser, ChannelInfo cChannel) {
32
+    public void onChannelSelfJoin(IRCParser tParser, IRCChannelInfo cChannel) {
33
         channel = cChannel;
33
         channel = cChannel;
34
     }
34
     }
35
 }
35
 }

+ 2
- 2
test/com/dmdirc/harness/parser/TestIChannelTopic.java View File

31
 
31
 
32
     public boolean isJoin;
32
     public boolean isJoin;
33
 
33
 
34
-    public ChannelInfo channel;
34
+    public IRCChannelInfo channel;
35
 
35
 
36
-    public void onChannelTopic(IRCParser tParser, ChannelInfo cChannel,
36
+    public void onChannelTopic(IRCParser tParser, IRCChannelInfo cChannel,
37
                                boolean bIsJoinTopic) {
37
                                boolean bIsJoinTopic) {
38
         triggered = true;
38
         triggered = true;
39
         isJoin = bIsJoinTopic;
39
         isJoin = bIsJoinTopic;

+ 2
- 2
test/com/dmdirc/harness/parser/TestIQuit.java View File

28
 
28
 
29
 public class TestIQuit implements ChannelQuitListener, QuitListener {
29
 public class TestIQuit implements ChannelQuitListener, QuitListener {
30
 
30
 
31
-    public ChannelInfo channel;
31
+    public IRCChannelInfo channel;
32
 
32
 
33
     public ChannelClientInfo cclient;
33
     public ChannelClientInfo cclient;
34
 
34
 
38
 
38
 
39
     public int count = 0;
39
     public int count = 0;
40
 
40
 
41
-    public void onChannelQuit(IRCParser tParser, ChannelInfo cChannel,
41
+    public void onChannelQuit(IRCParser tParser, IRCChannelInfo cChannel,
42
                               ChannelClientInfo cChannelClient, String sReason) {
42
                               ChannelClientInfo cChannelClient, String sReason) {
43
         this.channel = cChannel;
43
         this.channel = cChannel;
44
         this.cclient = cChannelClient;
44
         this.cclient = cChannelClient;

+ 23
- 22
test/com/dmdirc/parser/irc/ChannelInfoTest.java View File

23
 
23
 
24
 import com.dmdirc.harness.parser.TestParser;
24
 import com.dmdirc.harness.parser.TestParser;
25
 
25
 
26
+import com.dmdirc.parser.interfaces.ChannelInfo;
26
 import java.util.HashMap;
27
 import java.util.HashMap;
27
 import java.util.Map;
28
 import java.util.Map;
28
 
29
 
32
 
33
 
33
 public class ChannelInfoTest {
34
 public class ChannelInfoTest {
34
 
35
 
35
-    final ChannelInfo ci = new ChannelInfo(null, "name");
36
+    final IRCChannelInfo ci = new IRCChannelInfo(null, "name");
36
 
37
 
37
     @Test
38
     @Test
38
     public void testGetName() {
39
     public void testGetName() {
81
     @Test
82
     @Test
82
     public void testSendMessage() {
83
     public void testSendMessage() {
83
         final TestParser parser = new TestParser();
84
         final TestParser parser = new TestParser();
84
-        getChannelInfo(parser).sendMessage("hello");
85
+        getChannel(parser).sendMessage("hello");
85
 
86
 
86
         assertEquals("PRIVMSG #DMDirc_testing :hello", parser.sentLines.get(0));
87
         assertEquals("PRIVMSG #DMDirc_testing :hello", parser.sentLines.get(0));
87
     }
88
     }
89
     @Test
90
     @Test
90
     public void testSendNotice() {
91
     public void testSendNotice() {
91
         final TestParser parser = new TestParser();
92
         final TestParser parser = new TestParser();
92
-        getChannelInfo(parser).sendNotice("hello");
93
+        getChannel(parser).sendNotice("hello");
93
 
94
 
94
         assertEquals("NOTICE #DMDirc_testing :hello", parser.sentLines.get(0));
95
         assertEquals("NOTICE #DMDirc_testing :hello", parser.sentLines.get(0));
95
     }
96
     }
97
     @Test
98
     @Test
98
     public void testSendCTCP() {
99
     public void testSendCTCP() {
99
         final TestParser parser = new TestParser();
100
         final TestParser parser = new TestParser();
100
-        getChannelInfo(parser).sendCTCP("type", "hello");
101
+        getChannel(parser).sendCTCP("type", "hello");
101
 
102
 
102
         assertEquals("PRIVMSG #DMDirc_testing :" + ((char) 1) + "TYPE hello" + ((char) 1),
103
         assertEquals("PRIVMSG #DMDirc_testing :" + ((char) 1) + "TYPE hello" + ((char) 1),
103
                 parser.sentLines.get(0));
104
                 parser.sentLines.get(0));
106
     @Test
107
     @Test
107
     public void testSendCTCPEmpty() {
108
     public void testSendCTCPEmpty() {
108
         final TestParser parser = new TestParser();
109
         final TestParser parser = new TestParser();
109
-        getChannelInfo(parser).sendCTCP("type", "");
110
+        getChannel(parser).sendCTCP("type", "");
110
 
111
 
111
         assertEquals("PRIVMSG #DMDirc_testing :" + ((char) 1) + "TYPE" + ((char) 1),
112
         assertEquals("PRIVMSG #DMDirc_testing :" + ((char) 1) + "TYPE" + ((char) 1),
112
                 parser.sentLines.get(0));
113
                 parser.sentLines.get(0));
115
     @Test
116
     @Test
116
     public void testSendAction() {
117
     public void testSendAction() {
117
         final TestParser parser = new TestParser();
118
         final TestParser parser = new TestParser();
118
-        getChannelInfo(parser).sendAction("moo");
119
+        getChannel(parser).sendAction("moo");
119
 
120
 
120
         assertEquals("PRIVMSG #DMDirc_testing :" + ((char) 1) + "ACTION moo" + ((char) 1),
121
         assertEquals("PRIVMSG #DMDirc_testing :" + ((char) 1) + "ACTION moo" + ((char) 1),
121
                 parser.sentLines.get(0));
122
                 parser.sentLines.get(0));
124
     @Test
125
     @Test
125
     public void testSendCTCPReply() {
126
     public void testSendCTCPReply() {
126
         final TestParser parser = new TestParser();
127
         final TestParser parser = new TestParser();
127
-        getChannelInfo(parser).sendCTCPReply("type", "moo");
128
+        getChannel(parser).sendCTCPReply("type", "moo");
128
 
129
 
129
         assertEquals("NOTICE #DMDirc_testing :" + ((char) 1) + "TYPE moo" + ((char) 1),
130
         assertEquals("NOTICE #DMDirc_testing :" + ((char) 1) + "TYPE moo" + ((char) 1),
130
                 parser.sentLines.get(0));
131
                 parser.sentLines.get(0));
133
     @Test
134
     @Test
134
     public void testSendCTCPReplyEmpty() {
135
     public void testSendCTCPReplyEmpty() {
135
         final TestParser parser = new TestParser();
136
         final TestParser parser = new TestParser();
136
-        getChannelInfo(parser).sendCTCPReply("type", "");
137
+        getChannel(parser).sendCTCPReply("type", "");
137
 
138
 
138
         assertEquals("NOTICE #DMDirc_testing :" + ((char) 1) + "TYPE" + ((char) 1),
139
         assertEquals("NOTICE #DMDirc_testing :" + ((char) 1) + "TYPE" + ((char) 1),
139
                 parser.sentLines.get(0));
140
                 parser.sentLines.get(0));
142
     @Test
143
     @Test
143
     public void testSendEmptyMessages() {
144
     public void testSendEmptyMessages() {
144
         final TestParser parser = new TestParser();
145
         final TestParser parser = new TestParser();
145
-        final ChannelInfo info = getChannelInfo(parser);
146
+        final ChannelInfo info = getChannel(parser);
146
         
147
         
147
         info.sendAction("");
148
         info.sendAction("");
148
         info.sendCTCP("", "");
149
         info.sendCTCP("", "");
156
     @Test
157
     @Test
157
     public void testGetSetParamMode() {
158
     public void testGetSetParamMode() {
158
         final TestParser parser = new TestParser();
159
         final TestParser parser = new TestParser();
159
-        final ChannelInfo info = getChannelInfo(parser);
160
+        final ChannelInfo info = getChannel(parser);
160
         parser.injectLine(":server 324 nick #DMDirc_testing +k lalala");
161
         parser.injectLine(":server 324 nick #DMDirc_testing +k lalala");
161
         parser.sentLines.clear();
162
         parser.sentLines.clear();
162
         
163
         
171
     @Test
172
     @Test
172
     public void testModeSendFull() {
173
     public void testModeSendFull() {
173
         final TestParser parser = new TestParser();
174
         final TestParser parser = new TestParser();
174
-        final ChannelInfo info = getChannelInfo(parser);
175
+        final ChannelInfo info = getChannel(parser);
175
 
176
 
176
         parser.sentLines.clear();
177
         parser.sentLines.clear();
177
         info.alterMode(true, 'i', null);
178
         info.alterMode(true, 'i', null);
196
     @Test
197
     @Test
197
     public void testModeSendExtra() {
198
     public void testModeSendExtra() {
198
         final TestParser parser = new TestParser();
199
         final TestParser parser = new TestParser();
199
-        final ChannelInfo info = getChannelInfo(parser);
200
+        final ChannelInfo info = getChannel(parser);
200
 
201
 
201
         parser.sentLines.clear();
202
         parser.sentLines.clear();
202
         info.alterMode(true, 'i', null);
203
         info.alterMode(true, 'i', null);
226
     @Test
227
     @Test
227
     public void testModeSendOptimisation1() {
228
     public void testModeSendOptimisation1() {
228
         final TestParser parser = new TestParser();
229
         final TestParser parser = new TestParser();
229
-        final ChannelInfo info = getChannelInfo(parser);
230
+        final ChannelInfo info = getChannel(parser);
230
 
231
 
231
         parser.sentLines.clear();
232
         parser.sentLines.clear();
232
         info.alterMode(true, 'i', null);
233
         info.alterMode(true, 'i', null);
250
     @Test
251
     @Test
251
     public void testModeSendOptimisation2() {
252
     public void testModeSendOptimisation2() {
252
         final TestParser parser = new TestParser();
253
         final TestParser parser = new TestParser();
253
-        final ChannelInfo info = getChannelInfo(parser);
254
+        final ChannelInfo info = getChannel(parser);
254
 
255
 
255
         parser.sentLines.clear();
256
         parser.sentLines.clear();
256
         info.alterMode(true, 'm', null);
257
         info.alterMode(true, 'm', null);
272
     @Test
273
     @Test
273
     public void testModeUnsetKey() {
274
     public void testModeUnsetKey() {
274
         final TestParser parser = new TestParser();
275
         final TestParser parser = new TestParser();
275
-        final ChannelInfo info = getChannelInfo(parser);
276
+        final ChannelInfo info = getChannel(parser);
276
         parser.injectLine(":server 324 nick #DMDirc_testing +k lalala");
277
         parser.injectLine(":server 324 nick #DMDirc_testing +k lalala");
277
         parser.sentLines.clear();
278
         parser.sentLines.clear();
278
         
279
         
294
         parser.injectLine(":foo!bar@baz JOIN #DMDirc_testing");
295
         parser.injectLine(":foo!bar@baz JOIN #DMDirc_testing");
295
         parser.injectLine(":flub!floo@fleeee JOIN #DMDirc_testing");
296
         parser.injectLine(":flub!floo@fleeee JOIN #DMDirc_testing");
296
 
297
 
297
-        assertNotSame(parser.getChannelInfo("#DMDirc_testing").getChannelClients(),
298
-                parser.getChannelInfo("#DMDirc_testing").getChannelClients());
299
-        assertEquals(parser.getChannelInfo("#DMDirc_testing").getChannelClients(),
300
-                parser.getChannelInfo("#DMDirc_testing").getChannelClients());
298
+        assertNotSame(parser.getChannel("#DMDirc_testing").getChannelClients(),
299
+                parser.getChannel("#DMDirc_testing").getChannelClients());
300
+        assertEquals(parser.getChannel("#DMDirc_testing").getChannelClients(),
301
+                parser.getChannel("#DMDirc_testing").getChannelClients());
301
     }
302
     }
302
     
303
     
303
     @Test @Ignore
304
     @Test @Ignore
304
     public void testModeUnsetKeyMultiple() {
305
     public void testModeUnsetKeyMultiple() {
305
         final TestParser parser = new TestParser();
306
         final TestParser parser = new TestParser();
306
-        final ChannelInfo info = getChannelInfo(parser);
307
+        final ChannelInfo info = getChannel(parser);
307
         parser.injectLine(":server 324 nick #DMDirc_testing +k lalala");
308
         parser.injectLine(":server 324 nick #DMDirc_testing +k lalala");
308
         parser.sentLines.clear();
309
         parser.sentLines.clear();
309
         
310
         
321
     @Test @Ignore
322
     @Test @Ignore
322
     public void testModeUnsetLimitMultiple() {
323
     public void testModeUnsetLimitMultiple() {
323
         final TestParser parser = new TestParser();
324
         final TestParser parser = new TestParser();
324
-        final ChannelInfo info = getChannelInfo(parser);
325
+        final ChannelInfo info = getChannel(parser);
325
         parser.injectLine(":server 324 nick #DMDirc_testing +l 73");
326
         parser.injectLine(":server 324 nick #DMDirc_testing +l 73");
326
         parser.sentLines.clear();
327
         parser.sentLines.clear();
327
         
328
         
346
         return res;
347
         return res;
347
     }
348
     }
348
 
349
 
349
-    private ChannelInfo getChannelInfo(final TestParser parser) {
350
+    private ChannelInfo getChannel(final TestParser parser) {
350
         parser.injectConnectionStrings();
351
         parser.injectConnectionStrings();
351
         parser.injectLine(":nick JOIN #DMDirc_testing");
352
         parser.injectLine(":nick JOIN #DMDirc_testing");
352
 
353
 

+ 2
- 2
test/com/dmdirc/parser/irc/IRCParserTest.java View File

404
         parser.injectLine(":server " + numeric2 + " nick #D :End of Channel Something List");
404
         parser.injectLine(":server " + numeric2 + " nick #D :End of Channel Something List");
405
 
405
 
406
         final List<ChannelListModeItem> items
406
         final List<ChannelListModeItem> items
407
-                = parser.getChannelInfo("#D").getListModeParam(mode);
407
+                = parser.getChannel("#D").getListModeParam(mode);
408
 
408
 
409
         assertEquals(3, items.size());
409
         assertEquals(3, items.size());
410
         boolean gotOne = false, gotTwo = false, gotThree = false;
410
         boolean gotOne = false, gotTwo = false, gotThree = false;
470
         parser.getCallbackManager().addCallback(ChannelKickListener.class, ick, "#D");
470
         parser.getCallbackManager().addCallback(ChannelKickListener.class, ick, "#D");
471
         parser.injectLine(":bar!me@moo KICK #D nick :Bye!");
471
         parser.injectLine(":bar!me@moo KICK #D nick :Bye!");
472
 
472
 
473
-        verify(ick).onChannelKick(same(parser), (ChannelInfo) anyObject(),
473
+        verify(ick).onChannelKick(same(parser), (IRCChannelInfo) anyObject(),
474
                 (ChannelClientInfo) anyObject(), (ChannelClientInfo) anyObject(),
474
                 (ChannelClientInfo) anyObject(), (ChannelClientInfo) anyObject(),
475
                 anyString(), anyString());
475
                 anyString(), anyString());
476
     }
476
     }

+ 2
- 2
test/com/dmdirc/parser/irc/ProcessJoinTest.java View File

49
         assertSame(parser, test.channel.getParser());
49
         assertSame(parser, test.channel.getParser());
50
         assertEquals(1, parser.getChannels().size());
50
         assertEquals(1, parser.getChannels().size());
51
         assertTrue(parser.getChannels().contains(test.channel));
51
         assertTrue(parser.getChannels().contains(test.channel));
52
-        assertEquals(test.channel, parser.getChannelInfo("#DMDirc_testing"));
52
+        assertEquals(test.channel, parser.getChannel("#DMDirc_testing"));
53
     }
53
     }
54
     
54
     
55
     @Test
55
     @Test
63
         parser.injectLine(":nick JOIN #DMDirc_testing");
63
         parser.injectLine(":nick JOIN #DMDirc_testing");
64
         parser.injectLine(":foo!bar@baz JOIN #DMDirc_testing");
64
         parser.injectLine(":foo!bar@baz JOIN #DMDirc_testing");
65
 
65
 
66
-        verify(test).onChannelJoin(parser, parser.getChannelInfo("#DMDirc_testing"),
66
+        verify(test).onChannelJoin(parser, parser.getChannel("#DMDirc_testing"),
67
                 parser.getClientInfo("foo!bar@baz").getChannelClients().get(0));
67
                 parser.getClientInfo("foo!bar@baz").getChannelClients().get(0));
68
     }    
68
     }    
69
 
69
 

+ 3
- 3
test/com/dmdirc/parser/irc/ProcessModeTest.java View File

138
         parser.injectLine(":server 366 nick #DMDirc_testing :End of /NAMES list");
138
         parser.injectLine(":server 366 nick #DMDirc_testing :End of /NAMES list");
139
         parser.injectLine(":server 324 nick #DMDirc_testing +Zstnl 1234");
139
         parser.injectLine(":server 324 nick #DMDirc_testing +Zstnl 1234");
140
 
140
 
141
-        assertEquals("1234", parser.getChannelInfo("#DMDirc_testing").getModeParam('l'));
141
+        assertEquals("1234", parser.getChannel("#DMDirc_testing").getModeParam('l'));
142
         
142
         
143
-        String modes = parser.getChannelInfo("#DMDirc_testing").getModeStr().split(" ")[0];
143
+        String modes = parser.getChannel("#DMDirc_testing").getModeStr().split(" ")[0];
144
         assertEquals(6, modes.length());
144
         assertEquals(6, modes.length());
145
         assertEquals('+', modes.charAt(0));
145
         assertEquals('+', modes.charAt(0));
146
         assertTrue(modes.indexOf('Z') > -1);
146
         assertTrue(modes.indexOf('Z') > -1);
151
         
151
         
152
         parser.injectLine(":server MODE #DMDirc_testing :-Z");
152
         parser.injectLine(":server MODE #DMDirc_testing :-Z");
153
         
153
         
154
-        modes = parser.getChannelInfo("#DMDirc_testing").getModeStr().split(" ")[0];
154
+        modes = parser.getChannel("#DMDirc_testing").getModeStr().split(" ")[0];
155
         assertEquals(5, modes.length());
155
         assertEquals(5, modes.length());
156
         assertEquals('+', modes.charAt(0));
156
         assertEquals('+', modes.charAt(0));
157
         assertTrue(modes.indexOf('s') > -1);
157
         assertTrue(modes.indexOf('s') > -1);

+ 5
- 5
test/com/dmdirc/parser/irc/ProcessNamesTest.java View File

53
         parser.injectLine(":server 366 nick #DMDirc_testing :End of /NAMES list");
53
         parser.injectLine(":server 366 nick #DMDirc_testing :End of /NAMES list");
54
 
54
 
55
         assertEquals(1, parser.getChannels().size());
55
         assertEquals(1, parser.getChannels().size());
56
-        assertNotNull(parser.getChannelInfo("#DMDirc_testing"));
57
-        assertEquals(4, parser.getChannelInfo("#DMDirc_testing").getChannelClients().size());
56
+        assertNotNull(parser.getChannel("#DMDirc_testing"));
57
+        assertEquals(4, parser.getChannel("#DMDirc_testing").getChannelClients().size());
58
         assertNotNull(parser.getClientInfo("luser"));
58
         assertNotNull(parser.getClientInfo("luser"));
59
         assertEquals(1, parser.getClientInfo("luser").getChannelClients().size());
59
         assertEquals(1, parser.getClientInfo("luser").getChannelClients().size());
60
 
60
 
61
         ChannelClientInfo cci = parser.getClientInfo("luser").getChannelClients().get(0);
61
         ChannelClientInfo cci = parser.getClientInfo("luser").getChannelClients().get(0);
62
-        assertEquals(parser.getChannelInfo("#DMDirc_testing"), cci.getChannel());
62
+        assertEquals(parser.getChannel("#DMDirc_testing"), cci.getChannel());
63
         assertEquals("+", cci.getChanModeStr(true));
63
         assertEquals("+", cci.getChanModeStr(true));
64
         
64
         
65
-        cci = parser.getChannelInfo("#DMDirc_testing").getUser("nick2");
65
+        cci = parser.getChannel("#DMDirc_testing").getUser("nick2");
66
         assertNotNull(cci);
66
         assertNotNull(cci);
67
         assertEquals("@+", cci.getChanModeStr(true));
67
         assertEquals("@+", cci.getChanModeStr(true));
68
 
68
 
69
-        cci = parser.getChannelInfo("#DMDirc_testing").getUser("nick3");
69
+        cci = parser.getChannel("#DMDirc_testing").getUser("nick3");
70
         assertNotNull(cci);
70
         assertNotNull(cci);
71
         assertEquals("", cci.getChanModeStr(true));
71
         assertEquals("", cci.getChanModeStr(true));
72
     }
72
     }

+ 2
- 2
test/com/dmdirc/parser/irc/ProcessNickTest.java View File

51
         assertEquals(1, parser.getClientInfo("LUSER").getChannelClients().size());
51
         assertEquals(1, parser.getClientInfo("LUSER").getChannelClients().size());
52
 
52
 
53
         ChannelClientInfo cci = parser.getClientInfo("LUSER").getChannelClients().get(0);
53
         ChannelClientInfo cci = parser.getClientInfo("LUSER").getChannelClients().get(0);
54
-        assertEquals(parser.getChannelInfo("#DMDirc_testing"), cci.getChannel());
54
+        assertEquals(parser.getChannel("#DMDirc_testing"), cci.getChannel());
55
         assertEquals("+", cci.getChanModeStr(true));
55
         assertEquals("+", cci.getChanModeStr(true));
56
         
56
         
57
         assertSame(cci.getClient(), tinc.client);
57
         assertSame(cci.getClient(), tinc.client);
73
         assertEquals(1, parser.getClientInfo("foobar").getChannelClients().size());
73
         assertEquals(1, parser.getClientInfo("foobar").getChannelClients().size());
74
 
74
 
75
         ChannelClientInfo cci = parser.getClientInfo("foobar").getChannelClients().get(0);
75
         ChannelClientInfo cci = parser.getClientInfo("foobar").getChannelClients().get(0);
76
-        assertEquals(parser.getChannelInfo("#DMDirc_testing"), cci.getChannel());
76
+        assertEquals(parser.getChannel("#DMDirc_testing"), cci.getChannel());
77
         assertEquals("+", cci.getChanModeStr(true));
77
         assertEquals("+", cci.getChanModeStr(true));
78
     }    
78
     }    
79
     
79
     

+ 4
- 4
test/com/dmdirc/parser/irc/ProcessPartTest.java View File

45
         final TestIChannelPart test = new TestIChannelPart();
45
         final TestIChannelPart test = new TestIChannelPart();
46
         parser.getCallbackManager().addCallback(ChannelPartListener.class, test);
46
         parser.getCallbackManager().addCallback(ChannelPartListener.class, test);
47
         
47
         
48
-        assertEquals(2, parser.getChannelInfo("#DMDirc_testing").getChannelClients().size());
48
+        assertEquals(2, parser.getChannel("#DMDirc_testing").getChannelClients().size());
49
         
49
         
50
         parser.injectLine(":luser!foo@barsville PART #DMDirc_testing :Bye bye, cruel world");
50
         parser.injectLine(":luser!foo@barsville PART #DMDirc_testing :Bye bye, cruel world");
51
         
51
         
52
-        assertEquals(1, parser.getChannelInfo("#DMDirc_testing").getChannelClients().size());
52
+        assertEquals(1, parser.getChannel("#DMDirc_testing").getChannelClients().size());
53
         
53
         
54
         assertNotNull(test.channel);
54
         assertNotNull(test.channel);
55
         assertNotNull(test.cclient);
55
         assertNotNull(test.cclient);
73
         final TestIChannelPart test = new TestIChannelPart();
73
         final TestIChannelPart test = new TestIChannelPart();
74
         parser.getCallbackManager().addCallback(ChannelPartListener.class, test);
74
         parser.getCallbackManager().addCallback(ChannelPartListener.class, test);
75
         
75
         
76
-        assertEquals(2, parser.getChannelInfo("#DMDirc_testing").getChannelClients().size());
76
+        assertEquals(2, parser.getChannel("#DMDirc_testing").getChannelClients().size());
77
         
77
         
78
         parser.injectLine(":luser!foo@barsville PART #DMDirc_testing");
78
         parser.injectLine(":luser!foo@barsville PART #DMDirc_testing");
79
         
79
         
80
-        assertEquals(1, parser.getChannelInfo("#DMDirc_testing").getChannelClients().size());
80
+        assertEquals(1, parser.getChannel("#DMDirc_testing").getChannelClients().size());
81
         
81
         
82
         assertNotNull(test.channel);
82
         assertNotNull(test.channel);
83
         assertNotNull(test.cclient);
83
         assertNotNull(test.cclient);

+ 8
- 8
test/com/dmdirc/parser/irc/ProcessQuitTest.java View File

49
         final TestIQuit test = new TestIQuit();
49
         final TestIQuit test = new TestIQuit();
50
         parser.getCallbackManager().addCallback(ChannelQuitListener.class, test);
50
         parser.getCallbackManager().addCallback(ChannelQuitListener.class, test);
51
         
51
         
52
-        assertEquals(2, parser.getChannelInfo("#DMDirc_testing").getChannelClients().size());
52
+        assertEquals(2, parser.getChannel("#DMDirc_testing").getChannelClients().size());
53
         
53
         
54
         parser.injectLine(":luser!foo@barsville QUIT :Bye bye, cruel world");
54
         parser.injectLine(":luser!foo@barsville QUIT :Bye bye, cruel world");
55
         
55
         
56
-        assertEquals(1, parser.getChannelInfo("#DMDirc_testing").getChannelClients().size());
57
-        assertEquals(2, parser.getChannelInfo("#DMDirc_testing2").getChannelClients().size());
56
+        assertEquals(1, parser.getChannel("#DMDirc_testing").getChannelClients().size());
57
+        assertEquals(2, parser.getChannel("#DMDirc_testing2").getChannelClients().size());
58
         
58
         
59
         assertNotNull(test.channel);
59
         assertNotNull(test.channel);
60
         assertNotNull(test.cclient);
60
         assertNotNull(test.cclient);
82
         final TestIQuit test = new TestIQuit();
82
         final TestIQuit test = new TestIQuit();
83
         parser.getCallbackManager().addCallback(QuitListener.class, test);
83
         parser.getCallbackManager().addCallback(QuitListener.class, test);
84
         
84
         
85
-        assertEquals(2, parser.getChannelInfo("#DMDirc_testing").getChannelClients().size());
85
+        assertEquals(2, parser.getChannel("#DMDirc_testing").getChannelClients().size());
86
         
86
         
87
         parser.injectLine(":luser!foo@barsville QUIT :Bye bye, cruel world");
87
         parser.injectLine(":luser!foo@barsville QUIT :Bye bye, cruel world");
88
         
88
         
89
-        assertEquals(1, parser.getChannelInfo("#DMDirc_testing").getChannelClients().size());
90
-        assertEquals(2, parser.getChannelInfo("#DMDirc_testing2").getChannelClients().size());
89
+        assertEquals(1, parser.getChannel("#DMDirc_testing").getChannelClients().size());
90
+        assertEquals(2, parser.getChannel("#DMDirc_testing2").getChannelClients().size());
91
         
91
         
92
         assertNotNull(test.client);
92
         assertNotNull(test.client);
93
         assertNotNull(test.reason);
93
         assertNotNull(test.reason);
110
         final TestIQuit test = new TestIQuit();
110
         final TestIQuit test = new TestIQuit();
111
         parser.getCallbackManager().addCallback(QuitListener.class, test);
111
         parser.getCallbackManager().addCallback(QuitListener.class, test);
112
         
112
         
113
-        assertEquals(2, parser.getChannelInfo("#DMDirc_testing").getChannelClients().size());
113
+        assertEquals(2, parser.getChannel("#DMDirc_testing").getChannelClients().size());
114
         
114
         
115
         parser.injectLine(":luser!foo@barsville QUIT");
115
         parser.injectLine(":luser!foo@barsville QUIT");
116
         
116
         
117
-        assertEquals(1, parser.getChannelInfo("#DMDirc_testing").getChannelClients().size());
117
+        assertEquals(1, parser.getChannel("#DMDirc_testing").getChannelClients().size());
118
         
118
         
119
         assertNotNull(test.client);
119
         assertNotNull(test.client);
120
         assertNotNull(test.reason);
120
         assertNotNull(test.reason);

Loading…
Cancel
Save