Browse Source

Remove deprecated parser methods for converting strings

	- Updated everything to use non-deprecated way
Replace stupid implementations of handles() in callbacks with decent code.
Spaces -> Tabs *runs*

Issue 1274


git-svn-id: http://svn.dmdirc.com/trunk@4157 00569f92-eb28-0410-84fd-f71c24880f
tags/0.6
Shane Mc Cormack 16 years ago
parent
commit
264cf29661
31 changed files with 220 additions and 362 deletions
  1. 2
    2
      src/com/dmdirc/addons/nickcolours/NickColourPlugin.java
  2. 2
    2
      src/com/dmdirc/commandparser/commands/server/Ignore.java
  3. 2
    3
      src/com/dmdirc/parser/ChannelClientInfo.java
  4. 7
    7
      src/com/dmdirc/parser/ChannelInfo.java
  5. 7
    7
      src/com/dmdirc/parser/ChannelListModeItem.java
  6. 9
    9
      src/com/dmdirc/parser/ClientInfo.java
  7. 27
    75
      src/com/dmdirc/parser/IRCParser.java
  8. 5
    8
      src/com/dmdirc/parser/Process001.java
  9. 4
    5
      src/com/dmdirc/parser/Process004005.java
  10. 5
    8
      src/com/dmdirc/parser/Process464.java
  11. 4
    9
      src/com/dmdirc/parser/ProcessAway.java
  12. 4
    5
      src/com/dmdirc/parser/ProcessInvite.java
  13. 7
    12
      src/com/dmdirc/parser/ProcessJoin.java
  14. 6
    9
      src/com/dmdirc/parser/ProcessKick.java
  15. 6
    8
      src/com/dmdirc/parser/ProcessListModes.java
  16. 7
    15
      src/com/dmdirc/parser/ProcessMOTD.java
  17. 35
    53
      src/com/dmdirc/parser/ProcessMessage.java
  18. 11
    19
      src/com/dmdirc/parser/ProcessMode.java
  19. 5
    9
      src/com/dmdirc/parser/ProcessNames.java
  20. 9
    13
      src/com/dmdirc/parser/ProcessNick.java
  21. 8
    11
      src/com/dmdirc/parser/ProcessNickInUse.java
  22. 5
    8
      src/com/dmdirc/parser/ProcessNoticeAuth.java
  23. 6
    9
      src/com/dmdirc/parser/ProcessPart.java
  24. 8
    12
      src/com/dmdirc/parser/ProcessQuit.java
  25. 5
    10
      src/com/dmdirc/parser/ProcessTopic.java
  26. 9
    13
      src/com/dmdirc/parser/ProcessWallops.java
  27. 5
    9
      src/com/dmdirc/parser/ProcessWho.java
  28. 1
    2
      src/com/dmdirc/parser/ProcessingManager.java
  29. 6
    6
      src/com/dmdirc/parser/callbacks/CallbackManager.java
  30. 1
    2
      src/com/dmdirc/parser/callbacks/CallbackObject.java
  31. 2
    2
      src/com/dmdirc/parser/callbacks/CallbackObjectSpecific.java

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

93
         final Map map = client.getMap();
93
         final Map map = client.getMap();
94
         final ClientInfo myself = client.getClient().getParser().getMyself();
94
         final ClientInfo myself = client.getClient().getParser().getMyself();
95
         final String nickOption1 = "color:"
95
         final String nickOption1 = "color:"
96
-                + client.getClient().getParser().toLowerCase(network + ":" + client.getNickname());
96
+                + client.getClient().getParser().getIRCStringConverter().toLowerCase(network + ":" + client.getNickname());
97
         final String nickOption2 = "color:"
97
         final String nickOption2 = "color:"
98
-                + client.getClient().getParser().toLowerCase("*:" + client.getNickname());
98
+                + client.getClient().getParser().getIRCStringConverter().toLowerCase("*:" + client.getNickname());
99
         
99
         
100
         if (IdentityManager.getGlobalConfig().getOptionBool(DOMAIN, "useowncolour", false)
100
         if (IdentityManager.getGlobalConfig().getOptionBool(DOMAIN, "useowncolour", false)
101
                 && client.getClient().equals(myself)) {
101
                 && client.getClient().equals(myself)) {

+ 2
- 2
src/com/dmdirc/commandparser/commands/server/Ignore.java View File

102
             
102
             
103
         } else if (args[0].toLowerCase().equals("remove") && args.length > 1) {
103
         } else if (args[0].toLowerCase().equals("remove") && args.length > 1) {
104
             
104
             
105
-            final String host = server.getParser().toLowerCase(implodeArgs(1, args));
105
+            final String host = server.getParser().getIRCStringConverter().toLowerCase(implodeArgs(1, args));
106
             
106
             
107
             final StringBuffer newlist = new StringBuffer();
107
             final StringBuffer newlist = new StringBuffer();
108
             boolean found = false;
108
             boolean found = false;
112
                 
112
                 
113
                 
113
                 
114
                 for (String entry : list.split("\n")) {
114
                 for (String entry : list.split("\n")) {
115
-                    if (server.getParser().toLowerCase(entry).equals(host)) {
115
+                    if (server.getParser().getIRCStringConverter().toLowerCase(entry).equals(host)) {
116
                         found = true;
116
                         found = true;
117
                     } else {
117
                     } else {
118
                         if (newlist.length() > 0) {
118
                         if (newlist.length() > 0) {

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

191
 	 *
191
 	 *
192
 	 * @return String Value of user (inc prefix) (ie @Nickname)
192
 	 * @return String Value of user (inc prefix) (ie @Nickname)
193
 	 */
193
 	 */
194
-    @Override
194
+	@Override
195
 	public String toString() { 
195
 	public String toString() { 
196
 		return this.getImportantModePrefix() + this.getNickname();
196
 		return this.getImportantModePrefix() + this.getNickname();
197
 	}	
197
 	}	
202
 	 * @param sReason Why are they being kicked? "" for no reason
202
 	 * @param sReason Why are they being kicked? "" for no reason
203
 	 */
203
 	 */
204
 	public void kick(final String sReason) {
204
 	public void kick(final String sReason) {
205
-		myParser.sendString("KICK " + myChannel + " " + this.getNickname()
206
-                + (sReason.isEmpty() ? sReason : " :" + sReason));
205
+		myParser.sendString("KICK " + myChannel + " " + this.getNickname() + (sReason.isEmpty() ? sReason : " :" + sReason));
207
 	}
206
 	}
208
 	
207
 	
209
 	/**
208
 	/**

+ 7
- 7
src/com/dmdirc/parser/ChannelInfo.java View File

64
 	
64
 	
65
 	/** Channel Name. */
65
 	/** Channel Name. */
66
 	private final String sName;
66
 	private final String sName;
67
-    
67
+	
68
 	/** Hashtable containing references to ChannelClients. */
68
 	/** Hashtable containing references to ChannelClients. */
69
 	private final Map<String, ChannelClientInfo> hChannelUserList = new Hashtable<String, ChannelClientInfo>();
69
 	private final Map<String, ChannelClientInfo> hChannelUserList = new Hashtable<String, ChannelClientInfo>();
70
 	/** Hashtable storing values for modes set in the channel that use parameters. */
70
 	/** Hashtable storing values for modes set in the channel that use parameters. */
294
 	 */
294
 	 */
295
 	public ChannelClientInfo getUser(String sWho) {
295
 	public ChannelClientInfo getUser(String sWho) {
296
 		sWho = ClientInfo.parseHost(sWho);
296
 		sWho = ClientInfo.parseHost(sWho);
297
-		sWho = myParser.toLowerCase(sWho);
297
+		sWho = myParser.getIRCStringConverter().toLowerCase(sWho);
298
 		if (hChannelUserList.containsKey(sWho)) {
298
 		if (hChannelUserList.containsKey(sWho)) {
299
 			return hChannelUserList.get(sWho);
299
 			return hChannelUserList.get(sWho);
300
 		}
300
 		}
326
 		ChannelClientInfo cTemp = getUser(cClient);
326
 		ChannelClientInfo cTemp = getUser(cClient);
327
 		if (cTemp == null) { 
327
 		if (cTemp == null) { 
328
 			cTemp = new ChannelClientInfo(myParser, cClient, this);
328
 			cTemp = new ChannelClientInfo(myParser, cClient, this);
329
-			hChannelUserList.put(myParser.toLowerCase(cTemp.getNickname()), cTemp);
329
+			hChannelUserList.put(myParser.getIRCStringConverter().toLowerCase(cTemp.getNickname()), cTemp);
330
 		}
330
 		}
331
 		return cTemp;
331
 		return cTemp;
332
 	}
332
 	}
345
 			if (clTemp != myParser.getMyself() && !clTemp.checkVisibility()) {
345
 			if (clTemp != myParser.getMyself() && !clTemp.checkVisibility()) {
346
 				myParser.removeClient(clTemp);
346
 				myParser.removeClient(clTemp);
347
 			}
347
 			}
348
-			hChannelUserList.remove(myParser.toLowerCase(cTemp.getNickname()));
348
+			hChannelUserList.remove(myParser.getIRCStringConverter().toLowerCase(cTemp.getNickname()));
349
 		}
349
 		}
350
 	}	
350
 	}	
351
 	
351
 	
364
 				hChannelUserList.remove(oldNickname);
364
 				hChannelUserList.remove(oldNickname);
365
 				// Add with the new key. (getNickname will return the new name not the
365
 				// Add with the new key. (getNickname will return the new name not the
366
 				// old one)
366
 				// old one)
367
-				hChannelUserList.put(myParser.toLowerCase(cTemp.getNickname()), cTemp);
367
+				hChannelUserList.put(myParser.getIRCStringConverter().toLowerCase(cTemp.getNickname()), cTemp);
368
 			}
368
 			}
369
 		}
369
 		}
370
 	}
370
 	}
520
 		}
520
 		}
521
 		final ArrayList<ChannelListModeItem> lModes = hListModes.get(cMode);
521
 		final ArrayList<ChannelListModeItem> lModes = hListModes.get(cMode);
522
 		for (int i = 0; i < lModes.size(); i++) {
522
 		for (int i = 0; i < lModes.size(); i++) {
523
-			if (myParser.equalsIgnoreCase(lModes.get(i).getItem(), newItem.getItem())) { 
523
+			if (myParser.getIRCStringConverter().equalsIgnoreCase(lModes.get(i).getItem(), newItem.getItem())) { 
524
 				if (bAdd) { return; }
524
 				if (bAdd) { return; }
525
 				else { 
525
 				else { 
526
 					lModes.remove(i);
526
 					lModes.remove(i);
742
 	 *
742
 	 *
743
 	 * @return String representation of the Channel.
743
 	 * @return String representation of the Channel.
744
 	 */
744
 	 */
745
-    @Override
745
+	@Override
746
 	public String toString() { return sName; }
746
 	public String toString() { return sName; }
747
 	
747
 	
748
 	/**
748
 	/**

+ 7
- 7
src/com/dmdirc/parser/ChannelListModeItem.java View File

34
  */
34
  */
35
 public final class ChannelListModeItem {
35
 public final class ChannelListModeItem {
36
 
36
 
37
-    /** The Item itself. */
37
+	/** The Item itself. */
38
 	private final String myItem;
38
 	private final String myItem;
39
 	
39
 	
40
 	/** The Time the item was created. */
40
 	/** The Time the item was created. */
55
 		myTime = time;
55
 		myTime = time;
56
 
56
 
57
 		if (!owner.isEmpty() && owner.charAt(0) == ':') {
57
 		if (!owner.isEmpty() && owner.charAt(0) == ':') {
58
-            myOwner = owner.substring(1);
59
-        } else {
60
-            myOwner = owner;
61
-        }
58
+			myOwner = owner.substring(1);
59
+		} else {
60
+			myOwner = owner;
61
+		}
62
 	}
62
 	}
63
 	
63
 	
64
 	/**
64
 	/**
87
 	*
87
 	*
88
 	* @return String representation of this object
88
 	* @return String representation of this object
89
 	*/
89
 	*/
90
-    @Override
90
+	@Override
91
 	public String toString() {
91
 	public String toString() {
92
-			return getItem();
92
+		return getItem();
93
 	}
93
 	}
94
 
94
 
95
 }
95
 }

+ 9
- 9
src/com/dmdirc/parser/ClientInfo.java View File

179
 	 *
179
 	 *
180
 	 * @return String representation of the user.
180
 	 * @return String representation of the user.
181
 	 */
181
 	 */
182
-    @Override
182
+	@Override
183
 	public String toString() { return sNickname + "!" + sIdent + "@" + sHost; }
183
 	public String toString() { return sNickname + "!" + sIdent + "@" + sHost; }
184
 	
184
 	
185
 	/**
185
 	/**
188
 	 * @return Known nickname for user.
188
 	 * @return Known nickname for user.
189
 	 */
189
 	 */
190
 	public String getNickname() { return sNickname; }
190
 	public String getNickname() { return sNickname; }
191
-    
191
+	
192
 	/**
192
 	/**
193
 	 * Get the ident for this user.
193
 	 * Get the ident for this user.
194
 	 *
194
 	 *
195
 	 * @return Known ident for user. (May be "")
195
 	 * @return Known ident for user. (May be "")
196
 	 */		
196
 	 */		
197
 	public String getIdent() { return sIdent; }
197
 	public String getIdent() { return sIdent; }
198
-    
198
+	
199
 	/**
199
 	/**
200
 	 * Get the hostname for this user.
200
 	 * Get the hostname for this user.
201
 	 *
201
 	 *
213
 		bIsAway = bNewState;
213
 		bIsAway = bNewState;
214
 		if (!bIsAway) { myAwayReason = ""; }
214
 		if (!bIsAway) { myAwayReason = ""; }
215
 	}
215
 	}
216
-    
216
+	
217
 	/**
217
 	/**
218
 	 * Get the away state of a user.
218
 	 * Get the away state of a user.
219
 	 *
219
 	 *
227
 	 * @return Known away reason for user.
227
 	 * @return Known away reason for user.
228
 	 */
228
 	 */
229
 	public String getAwayReason() { return myAwayReason; }
229
 	public String getAwayReason() { return myAwayReason; }
230
-    
230
+	
231
 	/**
231
 	/**
232
 	 * Set the Away Reason for this user.
232
 	 * Set the Away Reason for this user.
233
 	 * Automatically set to "" if awaystate is set to false
233
 	 * Automatically set to "" if awaystate is set to false
242
 	 * @return Known RealName for user.
242
 	 * @return Known RealName for user.
243
 	 */
243
 	 */
244
 	public String getRealName() { return sRealName; }
244
 	public String getRealName() { return sRealName; }
245
-    
245
+	
246
 	/**
246
 	/**
247
 	 * Set the RealName for this user.
247
 	 * Set the RealName for this user.
248
 	 *
248
 	 *
256
 	 * @param nNewMode new long representing channel modes. (Boolean only)
256
 	 * @param nNewMode new long representing channel modes. (Boolean only)
257
 	 */	
257
 	 */	
258
 	protected void setUserMode(final long nNewMode) { nModes = nNewMode; }
258
 	protected void setUserMode(final long nNewMode) { nModes = nNewMode; }
259
-    
259
+	
260
 	/**
260
 	/**
261
 	 * Get the user modes (as an integer).
261
 	 * Get the user modes (as an integer).
262
 	 *
262
 	 *
300
 	 * @param cci ChannelClientInfo to add as a known reference
300
 	 * @param cci ChannelClientInfo to add as a known reference
301
 	 */	
301
 	 */	
302
 	public void addChannelClientInfo(final ChannelClientInfo cci) {
302
 	public void addChannelClientInfo(final ChannelClientInfo cci) {
303
-		final String key = myParser.toLowerCase(cci.getChannel().getName());
303
+		final String key = myParser.getIRCStringConverter().toLowerCase(cci.getChannel().getName());
304
 		if (!myChannelClientInfos.containsKey(key)) {
304
 		if (!myChannelClientInfos.containsKey(key)) {
305
 			myChannelClientInfos.put(key, cci);
305
 			myChannelClientInfos.put(key, cci);
306
 		}
306
 		}
312
 	 * @param cci ChannelClientInfo to remove as a known reference
312
 	 * @param cci ChannelClientInfo to remove as a known reference
313
 	 */	
313
 	 */	
314
 	public void delChannelClientInfo(final ChannelClientInfo cci) {
314
 	public void delChannelClientInfo(final ChannelClientInfo cci) {
315
-		final String key = myParser.toLowerCase(cci.getChannel().getName());
315
+		final String key = myParser.getIRCStringConverter().toLowerCase(cci.getChannel().getName());
316
 		if (myChannelClientInfos.containsKey(key)) {
316
 		if (myChannelClientInfos.containsKey(key)) {
317
 			myChannelClientInfos.remove(key);
317
 			myChannelClientInfos.remove(key);
318
 		}
318
 		}

+ 27
- 75
src/com/dmdirc/parser/IRCParser.java View File

238
 	/** This is the default TrustManager for SSL Sockets, it trusts all ssl certs. */
238
 	/** This is the default TrustManager for SSL Sockets, it trusts all ssl certs. */
239
 	private final TrustManager[] trustAllCerts = {
239
 	private final TrustManager[] trustAllCerts = {
240
 		new X509TrustManager() {
240
 		new X509TrustManager() {
241
-            @Override
242
-            public X509Certificate[] getAcceptedIssuers() { return null;	}
243
-            @Override
241
+			@Override
242
+			public X509Certificate[] getAcceptedIssuers() { return null; }
243
+			@Override
244
 			public void checkClientTrusted(final X509Certificate[] certs, final String authType) { }
244
 			public void checkClientTrusted(final X509Certificate[] certs, final String authType) { }
245
-            @Override
245
+			@Override
246
 			public void checkServerTrusted(final X509Certificate[] certs, final String authType) { }
246
 			public void checkServerTrusted(final X509Certificate[] certs, final String authType) { }
247
 		},
247
 		},
248
 	};
248
 	};
432
 	 * @return true if a method was called, false otherwise
432
 	 * @return true if a method was called, false otherwise
433
 	 */
433
 	 */
434
 	protected boolean callServerError(final String message) {
434
 	protected boolean callServerError(final String message) {
435
-		return ((CallbackOnServerError) myCallbackManager
436
-                .getCallbackType("OnServerError")).call(message);
435
+		return ((CallbackOnServerError) myCallbackManager.getCallbackType("OnServerError")).call(message);
437
 	}
436
 	}
438
 
437
 
439
 	/**
438
 	/**
444
 	 * @return true if a method was called, false otherwise
443
 	 * @return true if a method was called, false otherwise
445
 	 */
444
 	 */
446
 	protected boolean callDataIn(final String data) {
445
 	protected boolean callDataIn(final String data) {
447
-		return ((CallbackOnDataIn) myCallbackManager
448
-                .getCallbackType("OnDataIn")).call(data);
446
+		return ((CallbackOnDataIn) myCallbackManager.getCallbackType("OnDataIn")).call(data);
449
 	}
447
 	}
450
 
448
 
451
 	/**
449
 	/**
457
 	 * @see com.dmdirc.parser.callbacks.interfaces.IDataOut
455
 	 * @see com.dmdirc.parser.callbacks.interfaces.IDataOut
458
 	 */
456
 	 */
459
 	protected boolean callDataOut(final String data, final boolean fromParser) {
457
 	protected boolean callDataOut(final String data, final boolean fromParser) {
460
-		return ((CallbackOnDataOut) myCallbackManager
461
-                .getCallbackType("OnDataOut")).call(data, fromParser);
458
+		return ((CallbackOnDataOut) myCallbackManager.getCallbackType("OnDataOut")).call(data, fromParser);
462
 	}
459
 	}
463
 
460
 
464
 	/**
461
 	/**
482
 	 * @return true if a method was called, false otherwise
479
 	 * @return true if a method was called, false otherwise
483
 	 */
480
 	 */
484
 	protected boolean callDebugInfo(final int level, final String data) {
481
 	protected boolean callDebugInfo(final int level, final String data) {
485
-		return ((CallbackOnDebugInfo) myCallbackManager
486
-                .getCallbackType("OnDebugInfo")).call(level, data);
482
+		return ((CallbackOnDebugInfo) myCallbackManager.getCallbackType("OnDebugInfo")).call(level, data);
487
 	}
483
 	}
488
 
484
 
489
 	/**
485
 	/**
494
 	 * @return true if a method was called, false otherwise
490
 	 * @return true if a method was called, false otherwise
495
 	 */
491
 	 */
496
 	protected boolean callErrorInfo(final ParserError errorInfo) {
492
 	protected boolean callErrorInfo(final ParserError errorInfo) {
497
-		return ((CallbackOnErrorInfo) myCallbackManager
498
-                .getCallbackType("OnErrorInfo")).call(errorInfo);
493
+		return ((CallbackOnErrorInfo) myCallbackManager.getCallbackType("OnErrorInfo")).call(errorInfo);
499
 	}
494
 	}
500
 
495
 
501
 	/**
496
 	/**
506
 	 * @return true if a method was called, false otherwise
501
 	 * @return true if a method was called, false otherwise
507
 	 */
502
 	 */
508
 	protected boolean callConnectError(final ParserError errorInfo) {
503
 	protected boolean callConnectError(final ParserError errorInfo) {
509
-		return ((CallbackOnConnectError) myCallbackManager
510
-                .getCallbackType("OnConnectError")).call(errorInfo);
504
+		return ((CallbackOnConnectError) myCallbackManager.getCallbackType("OnConnectError")).call(errorInfo);
511
 	}
505
 	}
512
 
506
 
513
 	/**
507
 	/**
517
 	 * @return true if a method was called, false otherwise
511
 	 * @return true if a method was called, false otherwise
518
 	 */
512
 	 */
519
 	protected boolean callSocketClosed() {
513
 	protected boolean callSocketClosed() {
520
-		return ((CallbackOnSocketClosed) myCallbackManager
521
-                .getCallbackType("OnSocketClosed")).call();
514
+		return ((CallbackOnSocketClosed) myCallbackManager.getCallbackType("OnSocketClosed")).call();
522
 	}
515
 	}
523
 
516
 
524
 	/**
517
 	/**
528
 	 * @return true if a method was called, false otherwise
521
 	 * @return true if a method was called, false otherwise
529
 	 */
522
 	 */
530
 	protected boolean callPingFailed() {
523
 	protected boolean callPingFailed() {
531
-		return ((CallbackOnPingFailed) myCallbackManager
532
-                .getCallbackType("OnPingFailed")).call();
524
+		return ((CallbackOnPingFailed) myCallbackManager.getCallbackType("OnPingFailed")).call();
533
 	}
525
 	}
534
 
526
 
535
 	/**
527
 	/**
539
 	 * @return true if a method was called, false otherwise
531
 	 * @return true if a method was called, false otherwise
540
 	 */
532
 	 */
541
 	protected boolean callPingSent() {
533
 	protected boolean callPingSent() {
542
-		return ((CallbackOnPingSent) myCallbackManager
543
-                .getCallbackType("OnPingSent")).call();
534
+		return ((CallbackOnPingSent) myCallbackManager.getCallbackType("OnPingSent")).call();
544
 	}
535
 	}
545
 
536
 
546
 	/**
537
 	/**
550
 	 * @return true if a method was called, false otherwise
541
 	 * @return true if a method was called, false otherwise
551
 	 */
542
 	 */
552
 	protected boolean callPingSuccess() {
543
 	protected boolean callPingSuccess() {
553
-		return ((CallbackOnPingSuccess) myCallbackManager
554
-                .getCallbackType("OnPingSuccess")).call();
544
+		return ((CallbackOnPingSuccess) myCallbackManager.getCallbackType("OnPingSuccess")).call();
555
 	}
545
 	}
556
 
546
 
557
 	/**
547
 	/**
563
 	protected synchronized boolean callPost005() {
553
 	protected synchronized boolean callPost005() {
564
 		if (post005) { return false; }
554
 		if (post005) { return false; }
565
 		post005 = true;
555
 		post005 = true;
566
-        
567
-		return ((CallbackOnPost005) getCallbackManager()
568
-                .getCallbackType("OnPost005")).call();
556
+		
557
+		return ((CallbackOnPost005) getCallbackManager().getCallbackType("OnPost005")).call();
569
 	}
558
 	}
570
 
559
 
571
 	//---------------------------------------------------------------------------
560
 	//---------------------------------------------------------------------------
726
 		} catch (UnknownHostException uhe) {
715
 		} catch (UnknownHostException uhe) {
727
 			localhost = "*";
716
 			localhost = "*";
728
 		}
717
 		}
729
-		sendString("USER " + toLowerCase(me.getUsername()) + " "+localhost+" "+server.getHost()+" :" + me.getRealname());
718
+		sendString("USER " + getIRCStringConverter().toLowerCase(me.getUsername()) + " "+localhost+" "+server.getHost()+" :" + me.getRealname());
730
 	}
719
 	}
731
 
720
 
732
 	/**
721
 	/**
808
 	}
797
 	}
809
 
798
 
810
 	/** Close socket on destroy. */
799
 	/** Close socket on destroy. */
811
-    @Override
800
+	@Override
812
 	protected void finalize() throws Throwable {
801
 	protected void finalize() throws Throwable {
813
 		try { socket.close(); }
802
 		try { socket.close(); }
814
 		catch (IOException e) {
803
 		catch (IOException e) {
864
 	 * @return ClientInfo Object for the client, or null
853
 	 * @return ClientInfo Object for the client, or null
865
 	 */
854
 	 */
866
 	public ClientInfo getClientInfo(final String sHost) {
855
 	public ClientInfo getClientInfo(final String sHost) {
867
-		final String sWho = toLowerCase(ClientInfo.parseHost(sHost));
856
+		final String sWho = getIRCStringConverter().toLowerCase(ClientInfo.parseHost(sHost));
868
 		if (hClientList.containsKey(sWho)) { return hClientList.get(sWho); }
857
 		if (hClientList.containsKey(sWho)) { return hClientList.get(sWho); }
869
 		else { return null; }
858
 		else { return null; }
870
 	}
859
 	}
876
 	 * @return ClientInfo Object for the client.
865
 	 * @return ClientInfo Object for the client.
877
 	 */
866
 	 */
878
 	public ClientInfo getClientInfoOrFake(final String sHost) {
867
 	public ClientInfo getClientInfoOrFake(final String sHost) {
879
-		final String sWho = toLowerCase(ClientInfo.parseHost(sHost));
868
+		final String sWho = getIRCStringConverter().toLowerCase(ClientInfo.parseHost(sHost));
880
 		if (hClientList.containsKey(sWho)) { return hClientList.get(sWho); }
869
 		if (hClientList.containsKey(sWho)) { return hClientList.get(sWho); }
881
 		else { return new ClientInfo(this, sHost).setFake(true); }
870
 		else { return new ClientInfo(this, sHost).setFake(true); }
882
 	}
871
 	}
889
 	 */
878
 	 */
890
 	public ChannelInfo getChannelInfo(String sWhat) {
879
 	public ChannelInfo getChannelInfo(String sWhat) {
891
 		synchronized (hChannelList) {
880
 		synchronized (hChannelList) {
892
-			sWhat = toLowerCase(sWhat);
881
+			sWhat = getIRCStringConverter().toLowerCase(sWhat);
893
 			if (hChannelList.containsKey(sWhat)) { return hChannelList.get(sWhat); } else { return null; }
882
 			if (hChannelList.containsKey(sWhat)) { return hChannelList.get(sWhat); } else { return null; }
894
 		}
883
 		}
895
 	}
884
 	}
1084
 		stringConverter = new IRCStringConverter(limit);
1073
 		stringConverter = new IRCStringConverter(limit);
1085
 	}
1074
 	}
1086
 
1075
 
1087
-	/**
1088
-	 * Get the lowercase version of a String for this Server.
1089
-	 *
1090
-	 * @param input String to convert lowercase
1091
-	 * @return input String converterd to lowercase
1092
-     * @deprecated Use IRCStringConverter instead
1093
-	 */
1094
-    @Deprecated
1095
-	public String toLowerCase(final String input) {
1096
-		return getIRCStringConverter().toLowerCase(input);
1097
-	}
1098
-
1099
-	/**
1100
-	 * Get the uppercase version of a String for this Server.
1101
-	 *
1102
-	 * @param input String to convert uppercase
1103
-	 * @return input String converterd to uppercase
1104
-     * @deprecated Use IRCStringConverter instead
1105
-	 */
1106
-    @Deprecated
1107
-	public String toUpperCase(final String input) {
1108
-		return getIRCStringConverter().toUpperCase(input);
1109
-	}
1110
-
1111
-	/**
1112
-	 * Check if 2 strings are equal to each other ignoring case.
1113
-	 *
1114
-	 * @param first First string to check
1115
-	 * @param second Second string to check
1116
-	 * @return True if both strings are equal after being lowercased
1117
-     * @deprecated Use IRCStringConverter instead
1118
-	 */
1119
-    @Deprecated
1120
-	public boolean equalsIgnoreCase(final String first, final String second) {
1121
-		return getIRCStringConverter().equalsIgnoreCase(first, second);
1122
-	}
1123
-
1124
 	/**
1076
 	/**
1125
 	 * Get the known boolean chanmodes in 005 order.
1077
 	 * Get the known boolean chanmodes in 005 order.
1126
 	 * Modes are returned in the order that the ircd specifies the modes in 005
1078
 	 * Modes are returned in the order that the ircd specifies the modes in 005
1479
 		final String channelName;
1431
 		final String channelName;
1480
 		if (isValidChannelName(sChannelName)) {
1432
 		if (isValidChannelName(sChannelName)) {
1481
 			channelName = sChannelName;
1433
 			channelName = sChannelName;
1482
-        } else {
1434
+		} else {
1483
 			if (autoPrefix) {
1435
 			if (autoPrefix) {
1484
 				if (h005Info.containsKey("CHANTYPES")) {
1436
 				if (h005Info.containsKey("CHANTYPES")) {
1485
 					final String chantypes = h005Info.get("CHANTYPES");
1437
 					final String chantypes = h005Info.get("CHANTYPES");
1734
 		// Check sChannelName is not empty or null
1686
 		// Check sChannelName is not empty or null
1735
 		if (sChannelName == null || sChannelName.isEmpty()) { return false; }
1687
 		if (sChannelName == null || sChannelName.isEmpty()) { return false; }
1736
 		// Check its not ourself (PM recieved before 005)
1688
 		// Check its not ourself (PM recieved before 005)
1737
-		if (equalsIgnoreCase(getMyNickname(), sChannelName)) { return false; }
1689
+		if (getIRCStringConverter().equalsIgnoreCase(getMyNickname(), sChannelName)) { return false; }
1738
 		// Check if we are already on this channel
1690
 		// Check if we are already on this channel
1739
 		if (getChannelInfo(sChannelName) != null) { return true; }
1691
 		if (getChannelInfo(sChannelName) != null) { return true; }
1740
 		// Check if we know of any valid chan prefixes
1692
 		// Check if we know of any valid chan prefixes
1999
 	 * @param client Client to add
1951
 	 * @param client Client to add
2000
 	 */
1952
 	 */
2001
 	public void addClient(final ClientInfo client) {
1953
 	public void addClient(final ClientInfo client) {
2002
-		hClientList.put(toLowerCase(client.getNickname()),client);
1954
+		hClientList.put(getIRCStringConverter().toLowerCase(client.getNickname()),client);
2003
 	}
1955
 	}
2004
 
1956
 
2005
 	/**
1957
 	/**
2021
 	 * @param client Client to remove
1973
 	 * @param client Client to remove
2022
 	 */
1974
 	 */
2023
 	protected void forceRemoveClient(final ClientInfo client) {
1975
 	protected void forceRemoveClient(final ClientInfo client) {
2024
-		hClientList.remove(toLowerCase(client.getNickname()));
1976
+		hClientList.remove(getIRCStringConverter().toLowerCase(client.getNickname()));
2025
 	}
1977
 	}
2026
 
1978
 
2027
 	/**
1979
 	/**
2057
 	 */
2009
 	 */
2058
 	public void addChannel(final ChannelInfo channel) {
2010
 	public void addChannel(final ChannelInfo channel) {
2059
 		synchronized (hChannelList) {
2011
 		synchronized (hChannelList) {
2060
-			hChannelList.put(toLowerCase(channel.getName()), channel);
2012
+			hChannelList.put(getIRCStringConverter().toLowerCase(channel.getName()), channel);
2061
 		}
2013
 		}
2062
 	}
2014
 	}
2063
 
2015
 
2068
 	 */
2020
 	 */
2069
 	public void removeChannel(final ChannelInfo channel) {
2021
 	public void removeChannel(final ChannelInfo channel) {
2070
 		synchronized (hChannelList) {
2022
 		synchronized (hChannelList) {
2071
-			hChannelList.remove(toLowerCase(channel.getName()));
2023
+			hChannelList.remove(getIRCStringConverter().toLowerCase(channel.getName()));
2072
 		}
2024
 		}
2073
 	}
2025
 	}
2074
 
2026
 

+ 5
- 8
src/com/dmdirc/parser/Process001.java View File

36
 	 * @param sParam Type of line to process ("001")
36
 	 * @param sParam Type of line to process ("001")
37
 	 * @param token IRCTokenised line to process
37
 	 * @param token IRCTokenised line to process
38
 	 */
38
 	 */
39
-    @Override
39
+	@Override
40
 	public void process(final String sParam, final String[] token) {
40
 	public void process(final String sParam, final String[] token) {
41
 		myParser.got001 = true;
41
 		myParser.got001 = true;
42
 		// << :demon1.uk.quakenet.org 001 Java-Test :Welcome to the QuakeNet IRC Network, Java-Test
42
 		// << :demon1.uk.quakenet.org 001 Java-Test :Welcome to the QuakeNet IRC Network, Java-Test
65
 	 * Callback to all objects implementing the ServerReady Callback.
65
 	 * Callback to all objects implementing the ServerReady Callback.
66
 	 *
66
 	 *
67
 	 * @see IServerReady
67
 	 * @see IServerReady
68
-         * @return true if a method was called, false otherwise
68
+	 * @return true if a method was called, false otherwise
69
 	 */	
69
 	 */	
70
 	protected boolean callServerReady() {
70
 	protected boolean callServerReady() {
71
-		return ((CallbackOnServerReady) getCallbackManager()
72
-                .getCallbackType("OnServerReady")).call();
71
+		return ((CallbackOnServerReady) getCallbackManager().getCallbackType("OnServerReady")).call();
73
 	}
72
 	}
74
 	
73
 	
75
 	/**
74
 	/**
77
 	 *
76
 	 *
78
 	 * @return String[] with the names of the tokens we handle.
77
 	 * @return String[] with the names of the tokens we handle.
79
 	 */
78
 	 */
80
-    @Override
79
+	@Override
81
 	public String[] handles() {
80
 	public String[] handles() {
82
-		String[] iHandle = new String[1];
83
-		iHandle[0] = "001";
84
-		return iHandle;
81
+		return new String[]{"001"};
85
 	} 
82
 	} 
86
 	
83
 	
87
 	/**
84
 	/**

+ 4
- 5
src/com/dmdirc/parser/Process004005.java View File

36
 	 * @param sParam Type of line to process ("005", "004")
36
 	 * @param sParam Type of line to process ("005", "004")
37
 	 * @param token IRCTokenised line to process
37
 	 * @param token IRCTokenised line to process
38
 	 */
38
 	 */
39
-    @Override
39
+	@Override
40
 	public void process(final String sParam, final String[] token) {
40
 	public void process(final String sParam, final String[] token) {
41
 		if (sParam.equals("003")) {
41
 		if (sParam.equals("003")) {
42
 			myParser.h005Info.put("003IRCD",token[token.length-1]);
42
 			myParser.h005Info.put("003IRCD",token[token.length-1]);
107
 	 *
107
 	 *
108
 	 * @return String[] with the names of the tokens we handle.
108
 	 * @return String[] with the names of the tokens we handle.
109
 	 */
109
 	 */
110
-    @Override
110
+	@Override
111
 	public String[] handles() {
111
 	public String[] handles() {
112
 		return new String[]{"003", "004", "005"};
112
 		return new String[]{"003", "004", "005"};
113
 	} 
113
 	} 
117
 	 * This takes no params of its own, but works them out itself.
117
 	 * This takes no params of its own, but works them out itself.
118
 	 *
118
 	 *
119
 	 * @see IGotNetwork
119
 	 * @see IGotNetwork
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 callGotNetwork() {
122
 	protected boolean callGotNetwork() {
123
 		final String networkName = myParser.sNetworkName;
123
 		final String networkName = myParser.sNetworkName;
124
 		final String ircdVersion = myParser.getIRCD(false);
124
 		final String ircdVersion = myParser.getIRCD(false);
125
 		final String ircdType = myParser.getIRCD(true);
125
 		final String ircdType = myParser.getIRCD(true);
126
 		
126
 		
127
-		return ((CallbackOnGotNetwork) getCallbackManager()
128
-                .getCallbackType("OnGotNetwork")).call(networkName, ircdVersion, ircdType);
127
+		return ((CallbackOnGotNetwork) getCallbackManager().getCallbackType("OnGotNetwork")).call(networkName, ircdVersion, ircdType);
129
 	}
128
 	}
130
 	
129
 	
131
 	/**
130
 	/**

+ 5
- 8
src/com/dmdirc/parser/Process464.java View File

36
 	 * @param sParam Type of line to process ("464")
36
 	 * @param sParam Type of line to process ("464")
37
 	 * @param token IRCTokenised line to process
37
 	 * @param token IRCTokenised line to process
38
 	 */
38
 	 */
39
-    @Override
39
+	@Override
40
 	public void process(String sParam, String[] token) {
40
 	public void process(String sParam, String[] token) {
41
 		callPasswordRequired();
41
 		callPasswordRequired();
42
 //		ParserError ei = new ParserError(ParserError.ERROR_ERROR, "Password Required");
42
 //		ParserError ei = new ParserError(ParserError.ERROR_ERROR, "Password Required");
48
 	 *
48
 	 *
49
 	 * @return String[] with the names of the tokens we handle.
49
 	 * @return String[] with the names of the tokens we handle.
50
 	 */
50
 	 */
51
-    @Override
51
+	@Override
52
 	public String[] handles() {
52
 	public String[] handles() {
53
-		String[] iHandle = new String[1];
54
-		iHandle[0] = "464";
55
-		return iHandle;
53
+		return new String[]{"464"};
56
 	} 
54
 	} 
57
 	
55
 	
58
 	/**
56
 	/**
59
 	 * Callback to all objects implementing the PasswordRequired Callback.
57
 	 * Callback to all objects implementing the PasswordRequired Callback.
60
 	 *
58
 	 *
61
 	 * @see IPasswordRequired
59
 	 * @see IPasswordRequired
62
-         * @return true if a method was called, false otherwise
60
+	 * @return true if a method was called, false otherwise
63
 	 */
61
 	 */
64
 	protected boolean callPasswordRequired() {
62
 	protected boolean callPasswordRequired() {
65
-		return ((CallbackOnPasswordRequired) getCallbackManager()
66
-                .getCallbackType("OnPasswordRequired")).call();
63
+		return ((CallbackOnPasswordRequired) getCallbackManager().getCallbackType("OnPasswordRequired")).call();
67
 	}
64
 	}
68
 	
65
 	
69
 	/**
66
 	/**

+ 4
- 9
src/com/dmdirc/parser/ProcessAway.java View File

36
 	 * @param sParam Type of line to process ("305", "306")
36
 	 * @param sParam Type of line to process ("305", "306")
37
 	 * @param token IRCTokenised line to process
37
 	 * @param token IRCTokenised line to process
38
 	 */
38
 	 */
39
-    @Override
39
+	@Override
40
 	public void process(String sParam, String[] token) {
40
 	public void process(String sParam, String[] token) {
41
 		if (sParam.equals("301")) {
41
 		if (sParam.equals("301")) {
42
 			ClientInfo iClient = myParser.getClientInfo(token[3]);
42
 			ClientInfo iClient = myParser.getClientInfo(token[3]);
56
 	 * @return true if a method was called, false otherwise
56
 	 * @return true if a method was called, false otherwise
57
 	 */
57
 	 */
58
 	protected boolean callAwayState(boolean currentState, String reason) {
58
 	protected boolean callAwayState(boolean currentState, String reason) {
59
-		return ((CallbackOnAwayState) myParser.getCallbackManager()
60
-                .getCallbackType("OnAwayState")).call(currentState, reason);
59
+		return ((CallbackOnAwayState) myParser.getCallbackManager().getCallbackType("OnAwayState")).call(currentState, reason);
61
 	}
60
 	}
62
 	
61
 	
63
 	/**
62
 	/**
65
 	 *
64
 	 *
66
 	 * @return String[] with the names of the tokens we handle.
65
 	 * @return String[] with the names of the tokens we handle.
67
 	 */
66
 	 */
68
-    @Override
67
+	@Override
69
 	public String[] handles() {
68
 	public String[] handles() {
70
-		String[] iHandle = new String[3];
71
-		iHandle[0] = "301"; // Whois Away
72
-		iHandle[1] = "305";
73
-		iHandle[2] = "306";
74
-		return iHandle;
69
+		return new String[]{"301", "305", "306"};
75
 	} 
70
 	} 
76
 	
71
 	
77
 	/**
72
 	/**

+ 4
- 5
src/com/dmdirc/parser/ProcessInvite.java View File

36
 	 * @param sParam Type of line to process ("INVITE")
36
 	 * @param sParam Type of line to process ("INVITE")
37
 	 * @param token IRCTokenised line to process
37
 	 * @param token IRCTokenised line to process
38
 	 */
38
 	 */
39
-    @Override
39
+	@Override
40
 	public void process(final String sParam, final String[] token) {
40
 	public void process(final String sParam, final String[] token) {
41
 		// :Tobavaj!shane@Tobavaj.users.quakenet.org INVITE Dataforce #dataforceisgod 1188846462
41
 		// :Tobavaj!shane@Tobavaj.users.quakenet.org INVITE Dataforce #dataforceisgod 1188846462
42
 		if (token.length > 2) {
42
 		if (token.length > 2) {
50
 	 * @see IInvite
50
 	 * @see IInvite
51
 	 * @param userHost The hostname of the person who invited us
51
 	 * @param userHost The hostname of the person who invited us
52
 	 * @param channel The name of the channel we were invited to
52
 	 * @param channel The name of the channel we were invited to
53
-         * @return true if a method was called, false otherwise
53
+	 * @return true if a method was called, false otherwise
54
 	 */
54
 	 */
55
 	protected boolean callInvite(final String userHost, final String channel) {
55
 	protected boolean callInvite(final String userHost, final String channel) {
56
-		return ((CallbackOnInvite) getCallbackManager()
57
-                .getCallbackType("OnInvite")).call(userHost, channel);
56
+		return ((CallbackOnInvite) getCallbackManager().getCallbackType("OnInvite")).call(userHost, channel);
58
 	}
57
 	}
59
 	
58
 	
60
 	/**
59
 	/**
62
 	 *
61
 	 *
63
 	 * @return String[] with the names of the tokens we handle.
62
 	 * @return String[] with the names of the tokens we handle.
64
 	 */
63
 	 */
65
-    @Override
64
+	@Override
66
 	public String[] handles() {
65
 	public String[] handles() {
67
 		return new String[]{"INVITE"};
66
 		return new String[]{"INVITE"};
68
 	} 
67
 	} 

+ 7
- 12
src/com/dmdirc/parser/ProcessJoin.java View File

32
  */
32
  */
33
 public class ProcessJoin extends IRCProcessor {
33
 public class ProcessJoin extends IRCProcessor {
34
 
34
 
35
-    /**
35
+	/**
36
 	 * Process a channel join.
36
 	 * Process a channel join.
37
 	 *
37
 	 *
38
 	 * @param sParam Type of line to process ("JOIN")
38
 	 * @param sParam Type of line to process ("JOIN")
39
 	 * @param token IRCTokenised line to process
39
 	 * @param token IRCTokenised line to process
40
 	 */
40
 	 */
41
-    @Override
41
+	@Override
42
 	public void process(final String sParam, final String[] token) {
42
 	public void process(final String sParam, final String[] token) {
43
 		if (sParam.equals("329")) {
43
 		if (sParam.equals("329")) {
44
 			if (token.length < 5) { return; }
44
 			if (token.length < 5) { return; }
111
 	 * @return true if a method was called, false otherwise
111
 	 * @return true if a method was called, false otherwise
112
 	 */
112
 	 */
113
 	protected boolean callChannelJoin(final ChannelInfo cChannel, final ChannelClientInfo cChannelClient) {
113
 	protected boolean callChannelJoin(final ChannelInfo cChannel, final ChannelClientInfo cChannelClient) {
114
-		return ((CallbackOnChannelJoin)getCallbackManager()
115
-                .getCallbackType("OnChannelJoin")).call(cChannel, cChannelClient);
114
+		return ((CallbackOnChannelJoin)getCallbackManager().getCallbackType("OnChannelJoin")).call(cChannel, cChannelClient);
116
 	}
115
 	}
117
 	
116
 	
118
 	/**
117
 	/**
120
 	 *
119
 	 *
121
 	 * @see IChannelSelfJoin
120
 	 * @see IChannelSelfJoin
122
 	 * @param cChannel Channel Object
121
 	 * @param cChannel Channel Object
123
-         * @return true if a method was called, false otherwise
122
+	 * @return true if a method was called, false otherwise
124
 	 */
123
 	 */
125
 	protected boolean callChannelSelfJoin(final ChannelInfo cChannel) {
124
 	protected boolean callChannelSelfJoin(final ChannelInfo cChannel) {
126
-		return ((CallbackOnChannelSelfJoin) getCallbackManager()
127
-                .getCallbackType("OnChannelSelfJoin")).call(cChannel);
125
+		return ((CallbackOnChannelSelfJoin) getCallbackManager().getCallbackType("OnChannelSelfJoin")).call(cChannel);
128
 	}
126
 	}
129
 	
127
 	
130
 	/**
128
 	/**
132
 	 *
130
 	 *
133
 	 * @return String[] with the names of the tokens we handle.
131
 	 * @return String[] with the names of the tokens we handle.
134
 	 */
132
 	 */
135
-    @Override
133
+	@Override
136
 	public String[] handles() {
134
 	public String[] handles() {
137
-		String[] iHandle = new String[2];
138
-		iHandle[0] = "JOIN";
139
-		iHandle[1] = "329";
140
-		return iHandle;
135
+		return new String[]{"JOIN", "329"};
141
 	} 
136
 	} 
142
 	
137
 	
143
 	/**
138
 	/**

+ 6
- 9
src/com/dmdirc/parser/ProcessKick.java View File

31
  */
31
  */
32
 public class ProcessKick extends IRCProcessor {
32
 public class ProcessKick extends IRCProcessor {
33
 
33
 
34
-    /**
34
+	/**
35
 	 * Process a channel kick.
35
 	 * Process a channel kick.
36
 	 *
36
 	 *
37
 	 * @param sParam Type of line to process ("KICK")
37
 	 * @param sParam Type of line to process ("KICK")
38
 	 * @param token IRCTokenised line to process
38
 	 * @param token IRCTokenised line to process
39
 	 */
39
 	 */
40
-    @Override
40
+	@Override
41
 	public void process(final String sParam, final String[] token) {
41
 	public void process(final String sParam, final String[] token) {
42
 		ChannelClientInfo iChannelClient;
42
 		ChannelClientInfo iChannelClient;
43
 		ChannelClientInfo iChannelKicker;
43
 		ChannelClientInfo iChannelKicker;
89
 	 * @param cKickedByClient ChannelClient that did the kicking (may be null if server)
89
 	 * @param cKickedByClient ChannelClient that did the kicking (may be null if server)
90
 	 * @param sReason Reason for kick (may be "")
90
 	 * @param sReason Reason for kick (may be "")
91
 	 * @param sKickedByHost Hostname of Kicker (or servername)
91
 	 * @param sKickedByHost Hostname of Kicker (or servername)
92
-         * @return true if a method was called, false otherwise
92
+	 * @return true if a method was called, false otherwise
93
 	 */
93
 	 */
94
 	protected boolean callChannelKick(ChannelInfo cChannel, ChannelClientInfo cKickedClient, ChannelClientInfo cKickedByClient, String sReason, String sKickedByHost) {
94
 	protected boolean callChannelKick(ChannelInfo cChannel, ChannelClientInfo cKickedClient, ChannelClientInfo cKickedByClient, String sReason, String sKickedByHost) {
95
-		return ((CallbackOnChannelKick) getCallbackManager()
96
-                .getCallbackType("OnChannelKick")).call(cChannel, cKickedClient, cKickedByClient, sReason, sKickedByHost);
95
+		return ((CallbackOnChannelKick) getCallbackManager().getCallbackType("OnChannelKick")).call(cChannel, cKickedClient, cKickedByClient, sReason, sKickedByHost);
97
 	}
96
 	}
98
 	
97
 	
99
 	/**
98
 	/**
101
 	 *
100
 	 *
102
 	 * @return String[] with the names of the tokens we handle.
101
 	 * @return String[] with the names of the tokens we handle.
103
 	 */
102
 	 */
104
-    @Override
103
+	@Override
105
 	public String[] handles() {
104
 	public String[] handles() {
106
-		String[] iHandle = new String[1];
107
-		iHandle[0] = "KICK";
108
-		return iHandle;
105
+		return new String[]{"KICK"};
109
 	} 
106
 	} 
110
 	
107
 	
111
 	/**
108
 	/**

+ 6
- 8
src/com/dmdirc/parser/ProcessListModes.java View File

41
 	 * @param token IRCTokenised line to process
41
 	 * @param token IRCTokenised line to process
42
 	 */
42
 	 */
43
 	@SuppressWarnings("unchecked")
43
 	@SuppressWarnings("unchecked")
44
-    @Override
44
+	@Override
45
 	public void process(String sParam, String[] token) {
45
 	public void process(String sParam, String[] token) {
46
 		ChannelInfo channel = getChannelInfo(token[3]);
46
 		ChannelInfo channel = getChannelInfo(token[3]);
47
 		String thisIRCD = myParser.getIRCD(true).toLowerCase();
47
 		String thisIRCD = myParser.getIRCD(true).toLowerCase();
157
 	 *
157
 	 *
158
 	 * @return String[] with the names of the tokens we handle.
158
 	 * @return String[] with the names of the tokens we handle.
159
 	 */
159
 	 */
160
-    @Override
160
+	@Override
161
 	public String[] handles() {
161
 	public String[] handles() {
162
-		String[] iHandle = new String[10];
163
-		int i = 0;
162
+		/*
164
 		// Ban List - All IRCds
163
 		// Ban List - All IRCds
165
 		iHandle[i++] = "367"; // Item
164
 		iHandle[i++] = "367"; // Item
166
 		iHandle[i++] = "368"; // End
165
 		iHandle[i++] = "368"; // End
186
 		iHandle[i++] = "482"; // End
185
 		iHandle[i++] = "482"; // End
187
 		
186
 		
188
 		// This is here to allow finding the processor for adding LISTMODE support
187
 		// This is here to allow finding the processor for adding LISTMODE support
189
-		iHandle[i++] = "__LISTMODE__";
190
-		return iHandle;
188
+		iHandle[i++] = "__LISTMODE__"; */
189
+		return new String[]{"367", "368", "344", "345", "346", "347", "348", "349", "482", "__LISTMODE__"};
191
 	}
190
 	}
192
 	
191
 	
193
 	/**
192
 	/**
198
 	 * @return true if a method was called, false otherwise
197
 	 * @return true if a method was called, false otherwise
199
 	 */
198
 	 */
200
 	protected boolean callChannelGotListModes(ChannelInfo cChannel) {
199
 	protected boolean callChannelGotListModes(ChannelInfo cChannel) {
201
-		return ((CallbackOnChannelGotListModes) getCallbackManager()
202
-                .getCallbackType("OnChannelGotListModes")).call(cChannel);
200
+		return ((CallbackOnChannelGotListModes) getCallbackManager().getCallbackType("OnChannelGotListModes")).call(cChannel);
203
 	}
201
 	}
204
 	
202
 	
205
 	/**
203
 	/**

+ 7
- 15
src/com/dmdirc/parser/ProcessMOTD.java View File

33
  */
33
  */
34
 public class ProcessMOTD extends IRCProcessor {
34
 public class ProcessMOTD extends IRCProcessor {
35
 
35
 
36
-    /**
36
+	/**
37
 	 * Process a MOTD Related Line.
37
 	 * Process a MOTD Related Line.
38
 	 *
38
 	 *
39
 	 * @param sParam Type of line to process ("375", "372", "376", "422")
39
 	 * @param sParam Type of line to process ("375", "372", "376", "422")
40
 	 * @param token IRCTokenised line to process
40
 	 * @param token IRCTokenised line to process
41
 	 */
41
 	 */
42
-    @Override
42
+	@Override
43
 	public void process(String sParam, String[] token) {
43
 	public void process(String sParam, String[] token) {
44
 		if (sParam.equals("375")) {
44
 		if (sParam.equals("375")) {
45
 			callMOTDStart(token[token.length-1]);
45
 			callMOTDStart(token[token.length-1]);
63
 	 * @return true if a method was called, false otherwise
63
 	 * @return true if a method was called, false otherwise
64
 	 */
64
 	 */
65
 	protected boolean callMOTDEnd(final boolean noMOTD, final String data) {
65
 	protected boolean callMOTDEnd(final boolean noMOTD, final String data) {
66
-		return ((CallbackOnMOTDEnd) getCallbackManager()
67
-                .getCallbackType("OnMOTDEnd")).call(noMOTD, data);
66
+		return ((CallbackOnMOTDEnd) getCallbackManager().getCallbackType("OnMOTDEnd")).call(noMOTD, data);
68
 	}
67
 	}
69
 	
68
 	
70
 	/**
69
 	/**
75
 	 * @return true if a method was called, false otherwise
74
 	 * @return true if a method was called, false otherwise
76
 	 */
75
 	 */
77
 	protected boolean callMOTDLine(final String data) {
76
 	protected boolean callMOTDLine(final String data) {
78
-		return ((CallbackOnMOTDLine) getCallbackManager()
79
-                .getCallbackType("OnMOTDLine")).call(data);
77
+		return ((CallbackOnMOTDLine) getCallbackManager().getCallbackType("OnMOTDLine")).call(data);
80
 	}
78
 	}
81
 	
79
 	
82
 	/**
80
 	/**
87
 	 * @return true if a method was called, false otherwise
85
 	 * @return true if a method was called, false otherwise
88
 	 */
86
 	 */
89
 	protected boolean callMOTDStart(String data) {
87
 	protected boolean callMOTDStart(String data) {
90
-		return ((CallbackOnMOTDStart) getCallbackManager()
91
-                .getCallbackType("OnMOTDStart")).call(data);
88
+		return ((CallbackOnMOTDStart) getCallbackManager().getCallbackType("OnMOTDStart")).call(data);
92
 	}
89
 	}
93
 	
90
 	
94
 	/**
91
 	/**
96
 	 *
93
 	 *
97
 	 * @return String[] with the names of the tokens we handle.
94
 	 * @return String[] with the names of the tokens we handle.
98
 	 */
95
 	 */
99
-    @Override
96
+	@Override
100
 	public String[] handles() {
97
 	public String[] handles() {
101
-		String[] iHandle = new String[4];
102
-		iHandle[0] = "372";
103
-		iHandle[1] = "375";
104
-		iHandle[2] = "376";
105
-		iHandle[3] = "422";
106
-		return iHandle;
98
+		return new String[]{"372", "375", "376", "422"};
107
 	} 
99
 	} 
108
 	
100
 	
109
 	/**
101
 	/**

+ 35
- 53
src/com/dmdirc/parser/ProcessMessage.java View File

61
 	 * @param sParam Type of line to process ("NOTICE", "PRIVMSG")
61
 	 * @param sParam Type of line to process ("NOTICE", "PRIVMSG")
62
 	 * @param token IRCTokenised line to process
62
 	 * @param token IRCTokenised line to process
63
 	 */
63
 	 */
64
-    @Override
64
+	@Override
65
 	public void process(final String sParam, String[] token) {
65
 	public void process(final String sParam, String[] token) {
66
 		// Ignore people!
66
 		// Ignore people!
67
 		String sMessage = "";
67
 		String sMessage = "";
167
 					callChannelNotice(iChannel, iChannelClient, sMessage, token[0]);
167
 					callChannelNotice(iChannel, iChannelClient, sMessage, token[0]);
168
 				}
168
 				}
169
 			}
169
 			}
170
-		} else if (myParser.equalsIgnoreCase(token[2], myParser.getMyNickname())) {
170
+		} else if (myParser.getIRCStringConverter().equalsIgnoreCase(token[2], myParser.getMyNickname())) {
171
 			if (sParam.equalsIgnoreCase("PRIVMSG")) {
171
 			if (sParam.equalsIgnoreCase("PRIVMSG")) {
172
 				if (!isAction) {
172
 				if (!isAction) {
173
 					if (isCTCP) {
173
 					if (isCTCP) {
215
 	 * @param cChannelClient ChannelClient who sent the action (may be null if server)
215
 	 * @param cChannelClient ChannelClient who sent the action (may be null if server)
216
 	 * @param sMessage action contents
216
 	 * @param sMessage action contents
217
 	 * @param sHost Hostname of sender (or servername)
217
 	 * @param sHost Hostname of sender (or servername)
218
-         * @return true if a method was called, false otherwise
218
+	 * @return true if a method was called, false otherwise
219
 	 */
219
 	 */
220
 	protected boolean callChannelAction(final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sMessage, final String sHost) {
220
 	protected boolean callChannelAction(final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sMessage, final String sHost) {
221
-		return ((CallbackOnChannelAction) getCallbackManager()
222
-                .getCallbackType("OnChannelAction")).call(cChannel, cChannelClient, sMessage, sHost);
221
+		return ((CallbackOnChannelAction) getCallbackManager().getCallbackType("OnChannelAction")).call(cChannel, cChannelClient, sMessage, sHost);
223
 	}
222
 	}
224
 	
223
 	
225
 	/**
224
 	/**
231
 	 * @param sType Type of CTCP (VERSION, TIME etc)
230
 	 * @param sType Type of CTCP (VERSION, TIME etc)
232
 	 * @param sMessage Additional contents
231
 	 * @param sMessage Additional contents
233
 	 * @param sHost Hostname of sender (or servername)
232
 	 * @param sHost Hostname of sender (or servername)
234
-         * @return true if a method was called, false otherwise
233
+	 * @return true if a method was called, false otherwise
235
 	 */
234
 	 */
236
 	protected boolean callChannelCTCP(final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sType, final String sMessage, final String sHost) {
235
 	protected boolean callChannelCTCP(final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sType, final String sMessage, final String sHost) {
237
-		return ((CallbackOnChannelCTCP) getCallbackManager()
238
-                .getCallbackType("OnChannelCTCP")).call(cChannel, cChannelClient, sType, sMessage, sHost);
236
+		return ((CallbackOnChannelCTCP) getCallbackManager().getCallbackType("OnChannelCTCP")).call(cChannel, cChannelClient, sType, sMessage, sHost);
239
 	}
237
 	}
240
 
238
 
241
 	/**
239
 	/**
247
 	 * @param sType Type of CTCPRReply (VERSION, TIME etc)
245
 	 * @param sType Type of CTCPRReply (VERSION, TIME etc)
248
 	 * @param sMessage Reply Contents
246
 	 * @param sMessage Reply Contents
249
 	 * @param sHost Hostname of sender (or servername)
247
 	 * @param sHost Hostname of sender (or servername)
250
-         * @return true if a method was called, false otherwise
248
+	 * @return true if a method was called, false otherwise
251
 	 */
249
 	 */
252
 	protected boolean callChannelCTCPReply(final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sType, final String sMessage, final String sHost) {
250
 	protected boolean callChannelCTCPReply(final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sType, final String sMessage, final String sHost) {
253
-		return ((CallbackOnChannelCTCPReply) getCallbackManager()
254
-                .getCallbackType("OnChannelCTCPReply")).call(cChannel, cChannelClient, sType, sMessage, sHost);
251
+		return ((CallbackOnChannelCTCPReply) getCallbackManager().getCallbackType("OnChannelCTCPReply")).call(cChannel, cChannelClient, sType, sMessage, sHost);
255
 	}
252
 	}
256
 	
253
 	
257
 	/**
254
 	/**
262
 	 * @param cChannelClient ChannelClient who sent the message (may be null if server)
259
 	 * @param cChannelClient ChannelClient who sent the message (may be null if server)
263
 	 * @param sMessage Message contents
260
 	 * @param sMessage Message contents
264
 	 * @param sHost Hostname of sender (or servername)
261
 	 * @param sHost Hostname of sender (or servername)
265
-     * @return true if a method was called, false otherwise
262
+	 * @return true if a method was called, false otherwise
266
 	 */
263
 	 */
267
 	protected boolean callChannelMessage(final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sMessage, final String sHost) {
264
 	protected boolean callChannelMessage(final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sMessage, final String sHost) {
268
-		return ((CallbackOnChannelMessage) getCallbackManager()
269
-                .getCallbackType("OnChannelMessage")).call(cChannel, cChannelClient, sMessage, sHost);
265
+		return ((CallbackOnChannelMessage) getCallbackManager().getCallbackType("OnChannelMessage")).call(cChannel, cChannelClient, sMessage, sHost);
270
 	}
266
 	}
271
 	
267
 	
272
 	/**
268
 	/**
277
 	 * @param cChannelClient ChannelClient who sent the notice (may be null if server)
273
 	 * @param cChannelClient ChannelClient who sent the notice (may be null if server)
278
 	 * @param sMessage notice contents
274
 	 * @param sMessage notice contents
279
 	 * @param sHost Hostname of sender (or servername)
275
 	 * @param sHost Hostname of sender (or servername)
280
-     * @return true if a method was called, false otherwise
276
+	 * @return true if a method was called, false otherwise
281
 	 */
277
 	 */
282
 	protected boolean callChannelNotice(final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sMessage, final String sHost) {
278
 	protected boolean callChannelNotice(final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sMessage, final String sHost) {
283
-		return ((CallbackOnChannelNotice) getCallbackManager()
284
-                .getCallbackType("OnChannelNotice")).call(cChannel, cChannelClient, sMessage, sHost);
279
+		return ((CallbackOnChannelNotice) getCallbackManager().getCallbackType("OnChannelNotice")).call(cChannel, cChannelClient, sMessage, sHost);
285
 	}
280
 	}
286
 	
281
 	
287
 	/**
282
 	/**
290
 	 * @see com.dmdirc.parser.callbacks.interfaces.IPrivateAction
285
 	 * @see com.dmdirc.parser.callbacks.interfaces.IPrivateAction
291
 	 * @param sMessage action contents
286
 	 * @param sMessage action contents
292
 	 * @param sHost Hostname of sender (or servername)
287
 	 * @param sHost Hostname of sender (or servername)
293
-     * @return true if a method was called, false otherwise
288
+	 * @return true if a method was called, false otherwise
294
 	 */
289
 	 */
295
 	protected boolean callPrivateAction(final String sMessage, final String sHost) {
290
 	protected boolean callPrivateAction(final String sMessage, final String sHost) {
296
-		return ((CallbackOnPrivateAction) getCallbackManager()
297
-                .getCallbackType("OnPrivateAction")).call(sMessage, sHost);
291
+		return ((CallbackOnPrivateAction) getCallbackManager().getCallbackType("OnPrivateAction")).call(sMessage, sHost);
298
 	}
292
 	}
299
 
293
 
300
 	/**
294
 	/**
304
 	 * @param sType Type of CTCP (VERSION, TIME etc)
298
 	 * @param sType Type of CTCP (VERSION, TIME etc)
305
 	 * @param sMessage Additional contents
299
 	 * @param sMessage Additional contents
306
 	 * @param sHost Hostname of sender (or servername)
300
 	 * @param sHost Hostname of sender (or servername)
307
-     * @return true if a method was called, false otherwise
301
+	 * @return true if a method was called, false otherwise
308
 	 */
302
 	 */
309
 	protected boolean callPrivateCTCP(final String sType, final String sMessage, final String sHost) {
303
 	protected boolean callPrivateCTCP(final String sType, final String sMessage, final String sHost) {
310
-		return ((CallbackOnPrivateCTCP) getCallbackManager()
311
-                .getCallbackType("OnPrivateCTCP")).call(sType, sMessage, sHost);
304
+		return ((CallbackOnPrivateCTCP) getCallbackManager().getCallbackType("OnPrivateCTCP")).call(sType, sMessage, sHost);
312
 	}
305
 	}
313
 
306
 
314
 	/**
307
 	/**
318
 	 * @param sType Type of CTCPRReply (VERSION, TIME etc)
311
 	 * @param sType Type of CTCPRReply (VERSION, TIME etc)
319
 	 * @param sMessage Reply Contents
312
 	 * @param sMessage Reply Contents
320
 	 * @param sHost Hostname of sender (or servername)
313
 	 * @param sHost Hostname of sender (or servername)
321
-         * @return true if a method was called, false otherwise
314
+	 * @return true if a method was called, false otherwise
322
 	 */
315
 	 */
323
 	protected boolean callPrivateCTCPReply(final String sType, final String sMessage, final String sHost) {
316
 	protected boolean callPrivateCTCPReply(final String sType, final String sMessage, final String sHost) {
324
-		return ((CallbackOnPrivateCTCPReply) getCallbackManager()
325
-                .getCallbackType("OnPrivateCTCPReply")).call(sType, sMessage, sHost);
317
+		return ((CallbackOnPrivateCTCPReply) getCallbackManager().getCallbackType("OnPrivateCTCPReply")).call(sType, sMessage, sHost);
326
 	}
318
 	}
327
 
319
 
328
 	/**
320
 	/**
331
 	 * @see com.dmdirc.parser.callbacks.interfaces.IPrivateMessage
323
 	 * @see com.dmdirc.parser.callbacks.interfaces.IPrivateMessage
332
 	 * @param sMessage Message contents
324
 	 * @param sMessage Message contents
333
 	 * @param sHost Hostname of sender (or servername)
325
 	 * @param sHost Hostname of sender (or servername)
334
-         * @return true if a method was called, false otherwise
326
+	 * @return true if a method was called, false otherwise
335
 	 */
327
 	 */
336
 	protected boolean callPrivateMessage(final String sMessage, final String sHost) {
328
 	protected boolean callPrivateMessage(final String sMessage, final String sHost) {
337
-		return ((CallbackOnPrivateMessage) getCallbackManager()
338
-                .getCallbackType("OnPrivateMessage")).call(sMessage, sHost);
329
+		return ((CallbackOnPrivateMessage) getCallbackManager().getCallbackType("OnPrivateMessage")).call(sMessage, sHost);
339
 	}
330
 	}
340
 
331
 
341
 	/**
332
 	/**
344
 	 * @see com.dmdirc.parser.callbacks.interfaces.IPrivateNotice
335
 	 * @see com.dmdirc.parser.callbacks.interfaces.IPrivateNotice
345
 	 * @param sMessage Notice contents
336
 	 * @param sMessage Notice contents
346
 	 * @param sHost Hostname of sender (or servername)
337
 	 * @param sHost Hostname of sender (or servername)
347
-         * @return true if a method was called, false otherwise
338
+	 * @return true if a method was called, false otherwise
348
 	 */
339
 	 */
349
 	protected boolean callPrivateNotice(final String sMessage, final String sHost) {
340
 	protected boolean callPrivateNotice(final String sMessage, final String sHost) {
350
-		return ((CallbackOnPrivateNotice)getCallbackManager()
351
-                .getCallbackType("OnPrivateNotice")).call(sMessage, sHost);
341
+		return ((CallbackOnPrivateNotice)getCallbackManager().getCallbackType("OnPrivateNotice")).call(sMessage, sHost);
352
 	}
342
 	}
353
 	
343
 	
354
 	/**
344
 	/**
358
 	 * @param sMessage Action contents
348
 	 * @param sMessage Action contents
359
 	 * @param sTarget Actual target of action
349
 	 * @param sTarget Actual target of action
360
 	 * @param sHost Hostname of sender (or servername)
350
 	 * @param sHost Hostname of sender (or servername)
361
-         * @return true if a method was called, false otherwise
351
+	 * @return true if a method was called, false otherwise
362
 	 */
352
 	 */
363
 	protected boolean callUnknownAction(final String sMessage, final String sTarget, final String sHost) {
353
 	protected boolean callUnknownAction(final String sMessage, final String sTarget, final String sHost) {
364
-		return ((CallbackOnUnknownAction) getCallbackManager()
365
-                .getCallbackType("OnUnknownAction")).call(sMessage, sTarget, sHost);
354
+		return ((CallbackOnUnknownAction) getCallbackManager().getCallbackType("OnUnknownAction")).call(sMessage, sTarget, sHost);
366
 	}
355
 	}
367
 
356
 
368
 	/**
357
 	/**
373
 	 * @param sMessage Additional contents
362
 	 * @param sMessage Additional contents
374
 	 * @param sTarget Actual Target of CTCP
363
 	 * @param sTarget Actual Target of CTCP
375
 	 * @param sHost Hostname of sender (or servername)
364
 	 * @param sHost Hostname of sender (or servername)
376
-         * @return true if a method was called, false otherwise
365
+	 * @return true if a method was called, false otherwise
377
 	 */
366
 	 */
378
 	protected boolean callUnknownCTCP(final String sType, final String sMessage, final String sTarget, final String sHost) {
367
 	protected boolean callUnknownCTCP(final String sType, final String sMessage, final String sTarget, final String sHost) {
379
-		return ((CallbackOnUnknownCTCP)getCallbackManager()
380
-                .getCallbackType("OnUnknownCTCP")).call(sType, sMessage, sTarget, sHost);
368
+		return ((CallbackOnUnknownCTCP)getCallbackManager().getCallbackType("OnUnknownCTCP")).call(sType, sMessage, sTarget, sHost);
381
 	}
369
 	}
382
 
370
 
383
 	/**
371
 	/**
388
 	 * @param sMessage Reply Contents
376
 	 * @param sMessage Reply Contents
389
 	 * @param sTarget Actual Target of CTCPReply
377
 	 * @param sTarget Actual Target of CTCPReply
390
 	 * @param sHost Hostname of sender (or servername)
378
 	 * @param sHost Hostname of sender (or servername)
391
-         * @return true if a method was called, false otherwise
379
+	 * @return true if a method was called, false otherwise
392
 	 */
380
 	 */
393
 	protected boolean callUnknownCTCPReply(final String sType, final String sMessage, final String sTarget, final String sHost) {
381
 	protected boolean callUnknownCTCPReply(final String sType, final String sMessage, final String sTarget, final String sHost) {
394
-		return ((CallbackOnUnknownCTCPReply) getCallbackManager()
395
-                .getCallbackType("OnUnknownCTCPReply")).call(sType, sMessage, sTarget, sHost);
382
+		return ((CallbackOnUnknownCTCPReply) getCallbackManager().getCallbackType("OnUnknownCTCPReply")).call(sType, sMessage, sTarget, sHost);
396
 	}
383
 	}
397
 
384
 
398
 	/**
385
 	/**
402
 	 * @param sMessage Message contents
389
 	 * @param sMessage Message contents
403
 	 * @param sTarget Actual target of message
390
 	 * @param sTarget Actual target of message
404
 	 * @param sHost Hostname of sender (or servername)
391
 	 * @param sHost Hostname of sender (or servername)
405
-         * @return true if a method was called, false otherwise
392
+	 * @return true if a method was called, false otherwise
406
 	 */
393
 	 */
407
 	protected boolean callUnknownMessage(final String sMessage, final String sTarget, final String sHost) {
394
 	protected boolean callUnknownMessage(final String sMessage, final String sTarget, final String sHost) {
408
-		return ((CallbackOnUnknownMessage)getCallbackManager()
409
-                .getCallbackType("OnUnknownMessage")).call(sMessage, sTarget, sHost);
395
+		return ((CallbackOnUnknownMessage)getCallbackManager().getCallbackType("OnUnknownMessage")).call(sMessage, sTarget, sHost);
410
 	}
396
 	}
411
 
397
 
412
 	/**
398
 	/**
416
 	 * @param sMessage Notice contents
402
 	 * @param sMessage Notice contents
417
 	 * @param sTarget Actual target of notice
403
 	 * @param sTarget Actual target of notice
418
 	 * @param sHost Hostname of sender (or servername)
404
 	 * @param sHost Hostname of sender (or servername)
419
-         * @return true if a method was called, false otherwise
405
+	 * @return true if a method was called, false otherwise
420
 	 */
406
 	 */
421
 	protected boolean callUnknownNotice(final String sMessage, final String sTarget, final String sHost) {
407
 	protected boolean callUnknownNotice(final String sMessage, final String sTarget, final String sHost) {
422
-		return ((CallbackOnUnknownNotice) getCallbackManager()
423
-                .getCallbackType("OnUnknownNotice")).call(sMessage, sTarget, sHost);
408
+		return ((CallbackOnUnknownNotice) getCallbackManager().getCallbackType("OnUnknownNotice")).call(sMessage, sTarget, sHost);
424
 	}
409
 	}
425
 
410
 
426
 	
411
 	
429
 	 *
414
 	 *
430
 	 * @return String[] with the names of the tokens we handle.
415
 	 * @return String[] with the names of the tokens we handle.
431
 	 */
416
 	 */
432
-    @Override
417
+	@Override
433
 	public String[] handles() {
418
 	public String[] handles() {
434
-		String[] iHandle = new String[2];
435
-		iHandle[0] = "PRIVMSG";
436
-		iHandle[1] = "NOTICE";
437
-		return iHandle;
438
-	} 
419
+		return new String[]{"PRIVMSG", "NOTICE"};
420
+	}
439
 	
421
 	
440
 	/**
422
 	/**
441
 	 * Create a new instance of the IRCProcessor Object.
423
 	 * Create a new instance of the IRCProcessor Object.

+ 11
- 19
src/com/dmdirc/parser/ProcessMode.java View File

43
 	 * @param sParam Type of line to process ("MODE", "324")
43
 	 * @param sParam Type of line to process ("MODE", "324")
44
 	 * @param token IRCTokenised line to process
44
 	 * @param token IRCTokenised line to process
45
 	 */
45
 	 */
46
-    @Override
46
+	@Override
47
 	public void process(String sParam, String[] token) {
47
 	public void process(String sParam, String[] token) {
48
 		String[] sModestr;
48
 		String[] sModestr;
49
 		String sChannelName;
49
 		String sChannelName;
98
 		CallbackOnChannelSingleModeChanged cbSingle = null;
98
 		CallbackOnChannelSingleModeChanged cbSingle = null;
99
 		CallbackOnChannelNonUserModeChanged cbNonUser = null;
99
 		CallbackOnChannelNonUserModeChanged cbNonUser = null;
100
 
100
 
101
-        if (!sParam.equals("324")) {
101
+		if (!sParam.equals("324")) {
102
 			cbSingle = (CallbackOnChannelSingleModeChanged) getCallbackManager().getCallbackType("OnChannelSingleModeChanged");
102
 			cbSingle = (CallbackOnChannelSingleModeChanged) getCallbackManager().getCallbackType("OnChannelSingleModeChanged");
103
 			cbNonUser = (CallbackOnChannelNonUserModeChanged) getCallbackManager().getCallbackType("OnChannelNonUserModeChanged");
103
 			cbNonUser = (CallbackOnChannelNonUserModeChanged) getCallbackManager().getCallbackType("OnChannelNonUserModeChanged");
104
 		}
104
 		}
276
 	 * @param cChannelClient Client chaning the modes (null if server)
276
 	 * @param cChannelClient Client chaning the modes (null if server)
277
 	 * @param sHost Host doing the mode changing (User host or server name)
277
 	 * @param sHost Host doing the mode changing (User host or server name)
278
 	 * @param sModes Exact String parsed
278
 	 * @param sModes Exact String parsed
279
-         * @return true if a method was called, false otherwise
279
+	 * @return true if a method was called, false otherwise
280
 	 */
280
 	 */
281
 	protected boolean callChannelModeChanged(ChannelInfo cChannel, ChannelClientInfo cChannelClient, String sHost, String sModes) {
281
 	protected boolean callChannelModeChanged(ChannelInfo cChannel, ChannelClientInfo cChannelClient, String sHost, String sModes) {
282
-		return ((CallbackOnChannelModeChanged) getCallbackManager()
283
-                .getCallbackType("OnChannelModeChanged")).call(cChannel, cChannelClient, sHost, sModes);
282
+		return ((CallbackOnChannelModeChanged) getCallbackManager().getCallbackType("OnChannelModeChanged")).call(cChannel, cChannelClient, sHost, sModes);
284
 	}
283
 	}
285
 	
284
 	
286
 	/**
285
 	/**
292
 	 * @param cSetByClient Client chaning the modes (null if server)
291
 	 * @param cSetByClient Client chaning the modes (null if server)
293
 	 * @param sMode String representing mode change (ie +o)
292
 	 * @param sMode String representing mode change (ie +o)
294
 	 * @param sHost Host doing the mode changing (User host or server name)
293
 	 * @param sHost Host doing the mode changing (User host or server name)
295
-         * @return true if a method was called, false otherwise
294
+	 * @return true if a method was called, false otherwise
296
 	 */
295
 	 */
297
 	protected boolean callChannelUserModeChanged(ChannelInfo cChannel, ChannelClientInfo cChangedClient, ChannelClientInfo cSetByClient, String sHost, String sMode) {
296
 	protected boolean callChannelUserModeChanged(ChannelInfo cChannel, ChannelClientInfo cChangedClient, ChannelClientInfo cSetByClient, String sHost, String sMode) {
298
-		return ((CallbackOnChannelUserModeChanged) getCallbackManager()
299
-                .getCallbackType("OnChannelUserModeChanged")).call(cChannel, cChangedClient, cSetByClient, sHost, sMode);
297
+		return ((CallbackOnChannelUserModeChanged) getCallbackManager().getCallbackType("OnChannelUserModeChanged")).call(cChannel, cChangedClient, cSetByClient, sHost, sMode);
300
 	}
298
 	}
301
 	
299
 	
302
 	/**
300
 	/**
306
 	 * @param cClient Client that had the mode changed (almost always us)
304
 	 * @param cClient Client that had the mode changed (almost always us)
307
 	 * @param sSetby Host that set the mode (us or servername)
305
 	 * @param sSetby Host that set the mode (us or servername)
308
 	 * @param sModes The modes set.
306
 	 * @param sModes The modes set.
309
-         * @return true if a method was called, false otherwise
307
+	 * @return true if a method was called, false otherwise
310
 	 */
308
 	 */
311
 	protected boolean callUserModeChanged(ClientInfo cClient, String sSetby, String sModes) {
309
 	protected boolean callUserModeChanged(ClientInfo cClient, String sSetby, String sModes) {
312
-		return ((CallbackOnUserModeChanged) getCallbackManager()
313
-                .getCallbackType("OnUserModeChanged")).call(cClient, sSetby, sModes);
310
+		return ((CallbackOnUserModeChanged) getCallbackManager().getCallbackType("OnUserModeChanged")).call(cClient, sSetby, sModes);
314
 	}
311
 	}
315
 	
312
 	
316
 	/**
313
 	/**
322
 	 * @return true if a method was called, false otherwise
319
 	 * @return true if a method was called, false otherwise
323
 	 */
320
 	 */
324
 	protected boolean callUserModeDiscovered(ClientInfo cClient, String sModes) {
321
 	protected boolean callUserModeDiscovered(ClientInfo cClient, String sModes) {
325
-		return ((CallbackOnUserModeDiscovered)getCallbackManager()
326
-                .getCallbackType("OnUserModeDiscovered")).call(cClient, sModes);
322
+		return ((CallbackOnUserModeDiscovered)getCallbackManager().getCallbackType("OnUserModeDiscovered")).call(cClient, sModes);
327
 	}	
323
 	}	
328
 	
324
 	
329
 	/**
325
 	/**
331
 	 *
327
 	 *
332
 	 * @return String[] with the names of the tokens we handle.
328
 	 * @return String[] with the names of the tokens we handle.
333
 	 */
329
 	 */
334
-    @Override
330
+	@Override
335
 	public String[] handles() {
331
 	public String[] handles() {
336
-		String[] iHandle = new String[3];
337
-		iHandle[0] = "MODE";
338
-		iHandle[1] = "324";
339
-		iHandle[2] = "221";
340
-		return iHandle;
332
+		return new String[]{"MODE", "324", "221"};
341
 	} 
333
 	} 
342
 	
334
 	
343
 	/**
335
 	/**

+ 5
- 9
src/com/dmdirc/parser/ProcessNames.java View File

36
 	 * @param sParam Type of line to process ("366", "353")
36
 	 * @param sParam Type of line to process ("366", "353")
37
 	 * @param token IRCTokenised line to process
37
 	 * @param token IRCTokenised line to process
38
 	 */
38
 	 */
39
-    @Override
39
+	@Override
40
 	public void process(String sParam, String[] token) {
40
 	public void process(String sParam, String[] token) {
41
 		ChannelInfo iChannel;
41
 		ChannelInfo iChannel;
42
 		if (sParam.equals("366")) {
42
 		if (sParam.equals("366")) {
107
 	 *
107
 	 *
108
 	 * @see IChannelGotNames
108
 	 * @see IChannelGotNames
109
 	 * @param cChannel Channel which the names reply is for
109
 	 * @param cChannel Channel which the names reply is for
110
-         * @return true if a method was called, false otherwise
110
+	 * @return true if a method was called, false otherwise
111
 	 */
111
 	 */
112
 	protected boolean callChannelGotNames(ChannelInfo cChannel) {
112
 	protected boolean callChannelGotNames(ChannelInfo cChannel) {
113
-		return ((CallbackOnChannelGotNames) getCallbackManager()
114
-                .getCallbackType("OnChannelGotNames")).call(cChannel);
113
+		return ((CallbackOnChannelGotNames) getCallbackManager().getCallbackType("OnChannelGotNames")).call(cChannel);
115
 	}
114
 	}
116
 	
115
 	
117
 	/**
116
 	/**
119
 	 *
118
 	 *
120
 	 * @return String[] with the names of the tokens we handle.
119
 	 * @return String[] with the names of the tokens we handle.
121
 	 */
120
 	 */
122
-    @Override
121
+	@Override
123
 	public String[] handles() {
122
 	public String[] handles() {
124
-		String[] iHandle = new String[2];
125
-		iHandle[0] = "353";
126
-		iHandle[1] = "366";
127
-		return iHandle;
123
+		return new String[]{"353", "366"};
128
 	} 
124
 	} 
129
 	
125
 	
130
 	/**
126
 	/**

+ 9
- 13
src/com/dmdirc/parser/ProcessNick.java View File

37
 	 * @param sParam Type of line to process ("NICK")
37
 	 * @param sParam Type of line to process ("NICK")
38
 	 * @param token IRCTokenised line to process
38
 	 * @param token IRCTokenised line to process
39
 	 */
39
 	 */
40
-    @Override
40
+	@Override
41
 	public void process(String sParam, String[] token) {
41
 	public void process(String sParam, String[] token) {
42
 		ClientInfo iClient;
42
 		ClientInfo iClient;
43
 		ChannelClientInfo iChannelClient;
43
 		ChannelClientInfo iChannelClient;
45
 		
45
 		
46
 		iClient = getClientInfo(token[0]);
46
 		iClient = getClientInfo(token[0]);
47
 		if (iClient != null) {
47
 		if (iClient != null) {
48
-			oldNickname = myParser.toLowerCase(iClient.getNickname());
48
+			oldNickname = myParser.getIRCStringConverter().toLowerCase(iClient.getNickname());
49
 			// Remove the client from the known clients list
49
 			// Remove the client from the known clients list
50
-			final boolean isSameNick = myParser.equalsIgnoreCase(oldNickname, token[token.length-1]);
50
+			final boolean isSameNick = myParser.getIRCStringConverter().equalsIgnoreCase(oldNickname, token[token.length-1]);
51
 			
51
 			
52
 			if (!isSameNick) {
52
 			if (!isSameNick) {
53
 				myParser.forceRemoveClient(getClientInfo(oldNickname));
53
 				myParser.forceRemoveClient(getClientInfo(oldNickname));
90
 	 * @param cChannel One of the channels that the user is on
90
 	 * @param cChannel One of the channels that the user is on
91
 	 * @param cChannelClient Client changing nickname
91
 	 * @param cChannelClient Client changing nickname
92
 	 * @param sOldNick Nickname before change
92
 	 * @param sOldNick Nickname before change
93
-         * @return true if a method was called, false otherwise
93
+	 * @return true if a method was called, false otherwise
94
 	 */
94
 	 */
95
 	protected boolean callChannelNickChanged(ChannelInfo cChannel, ChannelClientInfo cChannelClient, String sOldNick) {
95
 	protected boolean callChannelNickChanged(ChannelInfo cChannel, ChannelClientInfo cChannelClient, String sOldNick) {
96
-		return ((CallbackOnChannelNickChanged) getCallbackManager()
97
-                .getCallbackType("OnChannelNickChanged")).call(cChannel, cChannelClient, sOldNick);
96
+		return ((CallbackOnChannelNickChanged) getCallbackManager().getCallbackType("OnChannelNickChanged")).call(cChannel, cChannelClient, sOldNick);
98
 	}
97
 	}
99
 	
98
 	
100
 	/**
99
 	/**
103
 	 * @see INickChanged
102
 	 * @see INickChanged
104
 	 * @param cClient Client changing nickname
103
 	 * @param cClient Client changing nickname
105
 	 * @param sOldNick Nickname before change
104
 	 * @param sOldNick Nickname before change
106
-         * @return true if a method was called, false otherwise
105
+	 * @return true if a method was called, false otherwise
107
 	 */
106
 	 */
108
 	protected boolean callNickChanged(ClientInfo cClient, String sOldNick) {
107
 	protected boolean callNickChanged(ClientInfo cClient, String sOldNick) {
109
-		return ((CallbackOnNickChanged) getCallbackManager()
110
-                .getCallbackType("OnNickChanged")).call(cClient, sOldNick);
108
+		return ((CallbackOnNickChanged) getCallbackManager().getCallbackType("OnNickChanged")).call(cClient, sOldNick);
111
 	}
109
 	}
112
 	
110
 	
113
 	/**
111
 	/**
115
 	 *
113
 	 *
116
 	 * @return String[] with the names of the tokens we handle.
114
 	 * @return String[] with the names of the tokens we handle.
117
 	 */
115
 	 */
118
-    @Override
116
+	@Override
119
 	public String[] handles() {
117
 	public String[] handles() {
120
-		String[] iHandle = new String[1];
121
-		iHandle[0] = "NICK";
122
-		return iHandle;
118
+		return new String[]{"NICK"};
123
 	} 
119
 	} 
124
 	
120
 	
125
 	/**
121
 	/**

+ 8
- 11
src/com/dmdirc/parser/ProcessNickInUse.java View File

48
 	 * @param sParam Type of line to process ("433")
48
 	 * @param sParam Type of line to process ("433")
49
 	 * @param token IRCTokenised line to process
49
 	 * @param token IRCTokenised line to process
50
 	 */
50
 	 */
51
-    @Override
51
+	@Override
52
 	public void process(final String sParam, final String[] token) {
52
 	public void process(final String sParam, final String[] token) {
53
 		if (!callNickInUse(token[3])) {
53
 		if (!callNickInUse(token[3])) {
54
 			// Manually handle nick in use.
54
 			// Manually handle nick in use.
57
 				callDebugInfo(IRCParser.DEBUG_INFO,"Using inbuilt handler");
57
 				callDebugInfo(IRCParser.DEBUG_INFO,"Using inbuilt handler");
58
 				// If this is before 001 we will try and get a nickname, else we will leave the nick as-is
58
 				// If this is before 001 we will try and get a nickname, else we will leave the nick as-is
59
 				if (myParser.triedAlt) {
59
 				if (myParser.triedAlt) {
60
-					if (myParser.equalsIgnoreCase(myParser.sThinkNickname, myParser.me.getAltNickname())) {
60
+					if (myParser.getIRCStringConverter().equalsIgnoreCase(myParser.sThinkNickname, myParser.me.getAltNickname())) {
61
 						myParser.sThinkNickname = myParser.me.getNickname();
61
 						myParser.sThinkNickname = myParser.me.getNickname();
62
 					}
62
 					}
63
-					myParser.setNickname(myParser.me.getPrependChar()+myParser.sThinkNickname);                                    
63
+					myParser.setNickname(myParser.me.getPrependChar()+myParser.sThinkNickname);
64
 				} else {
64
 				} else {
65
 					myParser.setNickname(myParser.me.getAltNickname());
65
 					myParser.setNickname(myParser.me.getAltNickname());
66
 					myParser.triedAlt = true; 
66
 					myParser.triedAlt = true; 
74
 	 *
74
 	 *
75
 	 * @param nickname Nickname that was wanted.
75
 	 * @param nickname Nickname that was wanted.
76
 	 * @see INickInUse
76
 	 * @see INickInUse
77
-         * @return true if a method was called, false otherwise
77
+	 * @return true if a method was called, false otherwise
78
 	 */
78
 	 */
79
 	protected boolean callNickInUse(final String nickname) {
79
 	protected boolean callNickInUse(final String nickname) {
80
-		return ((CallbackOnNickInUse) getCallbackManager()
81
-                .getCallbackType("OnNickInUse")).call(nickname);
80
+		return ((CallbackOnNickInUse) getCallbackManager().getCallbackType("OnNickInUse")).call(nickname);
82
 	}
81
 	}
83
 	
82
 	
84
 	/**
83
 	/**
86
 	 *
85
 	 *
87
 	 * @return String[] with the names of the tokens we handle.
86
 	 * @return String[] with the names of the tokens we handle.
88
 	 */
87
 	 */
89
-    @Override
88
+	@Override
90
 	public String[] handles() {
89
 	public String[] handles() {
91
-		String[] iHandle = new String[1];
92
-		iHandle[0] = "433";
93
-		return iHandle;
94
-	} 
90
+		return new String[]{"433"};
91
+	}
95
 	
92
 	
96
 	/**
93
 	/**
97
 	 * Create a new instance of the ProcessNickInUse Object.
94
 	 * Create a new instance of the ProcessNickInUse Object.

+ 5
- 8
src/com/dmdirc/parser/ProcessNoticeAuth.java View File

36
 	 * @param sParam Type of line to process ("Notice Auth")
36
 	 * @param sParam Type of line to process ("Notice Auth")
37
 	 * @param token IRCTokenised line to process
37
 	 * @param token IRCTokenised line to process
38
 	 */
38
 	 */
39
-    @Override
39
+	@Override
40
 	public void process(final String sParam, final String[] token) {
40
 	public void process(final String sParam, final String[] token) {
41
 		callNoticeAuth(token[token.length-1]);
41
 		callNoticeAuth(token[token.length-1]);
42
 	}
42
 	}
46
 	 *
46
 	 *
47
 	 * @see INoticeAuth
47
 	 * @see INoticeAuth
48
 	 * @param data Incomming Line.
48
 	 * @param data Incomming Line.
49
-         * @return true if a method was called, false otherwise
49
+	 * @return true if a method was called, false otherwise
50
 	 */
50
 	 */
51
 	protected boolean callNoticeAuth(final String data) {
51
 	protected boolean callNoticeAuth(final String data) {
52
-		return ((CallbackOnNoticeAuth) getCallbackManager()
53
-                .getCallbackType("OnNoticeAuth")).call(data);
52
+		return ((CallbackOnNoticeAuth) getCallbackManager().getCallbackType("OnNoticeAuth")).call(data);
54
 	}
53
 	}
55
 	
54
 	
56
 	/**
55
 	/**
58
 	 *
57
 	 *
59
 	 * @return String[] with the names of the tokens we handle.
58
 	 * @return String[] with the names of the tokens we handle.
60
 	 */
59
 	 */
61
-    @Override
60
+	@Override
62
 	public String[] handles() {
61
 	public String[] handles() {
63
-		String[] iHandle = new String[1];
64
-		iHandle[0] = "Notice Auth";
65
-		return iHandle;
62
+		return new String[]{"Notice Auth"};
66
 	} 
63
 	} 
67
 	
64
 	
68
 	/**
65
 	/**

+ 6
- 9
src/com/dmdirc/parser/ProcessPart.java View File

31
  */
31
  */
32
 public class ProcessPart extends IRCProcessor {
32
 public class ProcessPart extends IRCProcessor {
33
 
33
 
34
-    /**
34
+	/**
35
 	 * Process a channel part.
35
 	 * Process a channel part.
36
 	 *
36
 	 *
37
 	 * @param sParam Type of line to process ("PART")
37
 	 * @param sParam Type of line to process ("PART")
38
 	 * @param token IRCTokenised line to process
38
 	 * @param token IRCTokenised line to process
39
 	 */
39
 	 */
40
-    @Override
40
+	@Override
41
 	public void process(final String sParam, final String[] token) {
41
 	public void process(final String sParam, final String[] token) {
42
 		// :nick!ident@host PART #Channel
42
 		// :nick!ident@host PART #Channel
43
 		// :nick!ident@host PART #Channel :reason
43
 		// :nick!ident@host PART #Channel :reason
85
 	 * @param cChannel Channel that the user parted
85
 	 * @param cChannel Channel that the user parted
86
 	 * @param cChannelClient Client that parted
86
 	 * @param cChannelClient Client that parted
87
 	 * @param sReason Reason given for parting (May be "")
87
 	 * @param sReason Reason given for parting (May be "")
88
-         * @return true if a method was called, false otherwise
88
+	 * @return true if a method was called, false otherwise
89
 	 */
89
 	 */
90
 	protected boolean callChannelPart(final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sReason) {
90
 	protected boolean callChannelPart(final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sReason) {
91
-		return ((CallbackOnChannelPart) getCallbackManager()
92
-                .getCallbackType("OnChannelPart")).call(cChannel, cChannelClient, sReason);
91
+		return ((CallbackOnChannelPart) getCallbackManager().getCallbackType("OnChannelPart")).call(cChannel, cChannelClient, sReason);
93
 	}
92
 	}
94
 	
93
 	
95
 	/**
94
 	/**
97
 	 *
96
 	 *
98
 	 * @return String[] with the names of the tokens we handle.
97
 	 * @return String[] with the names of the tokens we handle.
99
 	 */
98
 	 */
100
-    @Override
99
+	@Override
101
 	public String[] handles() {
100
 	public String[] handles() {
102
-		String[] iHandle = new String[1];
103
-		iHandle[0] = "PART";
104
-		return iHandle;
101
+		return new String[]{"PART"};
105
 	} 
102
 	} 
106
 	
103
 	
107
 	/**
104
 	/**

+ 8
- 12
src/com/dmdirc/parser/ProcessQuit.java View File

33
  */
33
  */
34
 public class ProcessQuit extends IRCProcessor {
34
 public class ProcessQuit extends IRCProcessor {
35
 
35
 
36
-    /**
36
+	/**
37
 	 * Process a Quit message.
37
 	 * Process a Quit message.
38
 	 *
38
 	 *
39
 	 * @param sParam Type of line to process ("QUIT")
39
 	 * @param sParam Type of line to process ("QUIT")
40
 	 * @param token IRCTokenised line to process
40
 	 * @param token IRCTokenised line to process
41
 	 */
41
 	 */
42
-    @Override
42
+	@Override
43
 	public void process(final String sParam, final String[] token) {
43
 	public void process(final String sParam, final String[] token) {
44
 		// :nick!ident@host QUIT
44
 		// :nick!ident@host QUIT
45
 		// :nick!ident@host QUIT :reason
45
 		// :nick!ident@host QUIT :reason
88
 	 * @param cChannel Channel that user was on
88
 	 * @param cChannel Channel that user was on
89
 	 * @param cChannelClient User thats quitting
89
 	 * @param cChannelClient User thats quitting
90
 	 * @param sReason Quit reason
90
 	 * @param sReason Quit reason
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 callChannelQuit(final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sReason) {
93
 	protected boolean callChannelQuit(final ChannelInfo cChannel, final ChannelClientInfo cChannelClient, final String sReason) {
94
-		return ((CallbackOnChannelQuit) getCallbackManager()
95
-                .getCallbackType("OnChannelQuit")).call(cChannel, cChannelClient, sReason);
94
+		return ((CallbackOnChannelQuit) getCallbackManager().getCallbackType("OnChannelQuit")).call(cChannel, cChannelClient, sReason);
96
 	}
95
 	}
97
 	
96
 	
98
 	/**
97
 	/**
101
 	 * @see IQuit
100
 	 * @see IQuit
102
 	 * @param cClient Client Quitting
101
 	 * @param cClient Client Quitting
103
 	 * @param sReason Reason for quitting (may be "")
102
 	 * @param sReason Reason for quitting (may be "")
104
-         * @return true if a method was called, false otherwise
103
+	 * @return true if a method was called, false otherwise
105
 	 */
104
 	 */
106
 	protected boolean callQuit(final ClientInfo cClient, final String sReason) {
105
 	protected boolean callQuit(final ClientInfo cClient, final String sReason) {
107
-		return ((CallbackOnQuit) getCallbackManager()
108
-                .getCallbackType("OnQuit")).call(cClient, sReason);
106
+		return ((CallbackOnQuit) getCallbackManager().getCallbackType("OnQuit")).call(cClient, sReason);
109
 	}
107
 	}
110
 	
108
 	
111
 	/**
109
 	/**
113
 	 *
111
 	 *
114
 	 * @return String[] with the names of the tokens we handle.
112
 	 * @return String[] with the names of the tokens we handle.
115
 	 */
113
 	 */
116
-    @Override
114
+	@Override
117
 	public String[] handles() {
115
 	public String[] handles() {
118
-		String[] iHandle = new String[1];
119
-		iHandle[0] = "QUIT";
120
-		return iHandle;
116
+		return new String[]{"QUIT"};
121
 	} 
117
 	} 
122
 	
118
 	
123
 	/**
119
 	/**

+ 5
- 10
src/com/dmdirc/parser/ProcessTopic.java View File

36
 	 * @param sParam Type of line to process ("TOPIC", "332", "333")
36
 	 * @param sParam Type of line to process ("TOPIC", "332", "333")
37
 	 * @param token IRCTokenised line to process
37
 	 * @param token IRCTokenised line to process
38
 	 */
38
 	 */
39
-    @Override
39
+	@Override
40
 	public void process(final String sParam, final String[] token) {
40
 	public void process(final String sParam, final String[] token) {
41
 		ChannelInfo iChannel;
41
 		ChannelInfo iChannel;
42
 		if (sParam.equals("332")) {
42
 		if (sParam.equals("332")) {
76
 	 * @see IChannelTopic
76
 	 * @see IChannelTopic
77
 	 * @param cChannel Channel that topic was set on
77
 	 * @param cChannel Channel that topic was set on
78
 	 * @param bIsJoinTopic True when getting topic on join, false if set by user/server
78
 	 * @param bIsJoinTopic True when getting topic on join, false if set by user/server
79
-         * @return true if a method was called, false otherwise
79
+	 * @return true if a method was called, false otherwise
80
 	 */
80
 	 */
81
 	protected boolean callChannelTopic(final ChannelInfo cChannel, final boolean bIsJoinTopic) {
81
 	protected boolean callChannelTopic(final ChannelInfo cChannel, final boolean bIsJoinTopic) {
82
-		return ((CallbackOnChannelTopic) getCallbackManager()
83
-                .getCallbackType("OnChannelTopic")).call(cChannel, bIsJoinTopic);
82
+		return ((CallbackOnChannelTopic) getCallbackManager().getCallbackType("OnChannelTopic")).call(cChannel, bIsJoinTopic);
84
 	}
83
 	}
85
 	
84
 	
86
 	/**
85
 	/**
88
 	 *
87
 	 *
89
 	 * @return String[] with the names of the tokens we handle.
88
 	 * @return String[] with the names of the tokens we handle.
90
 	 */
89
 	 */
91
-    @Override
90
+	@Override
92
 	public String[] handles() {
91
 	public String[] handles() {
93
-		String[] iHandle = new String[3];
94
-		iHandle[0] = "TOPIC";
95
-		iHandle[1] = "332";
96
-		iHandle[2] = "333";
97
-		return iHandle;
92
+		return new String[]{"TOPIC", "332", "333"};
98
 	} 
93
 	} 
99
 	
94
 	
100
 	/**
95
 	/**

+ 9
- 13
src/com/dmdirc/parser/ProcessWallops.java View File

38
 	 * @param sParam Type of line to process ("WALLOPS")
38
 	 * @param sParam Type of line to process ("WALLOPS")
39
 	 * @param token IRCTokenised line to process
39
 	 * @param token IRCTokenised line to process
40
 	 */
40
 	 */
41
-    @Override
41
+	@Override
42
 	public void process(final String sParam, final String[] token) {
42
 	public void process(final String sParam, final String[] token) {
43
 		if (token.length < 3) { return; }
43
 		if (token.length < 3) { return; }
44
 		
44
 		
65
 	 * @see IWallop
65
 	 * @see IWallop
66
 	 * @param host Host of the user who sent the wallop
66
 	 * @param host Host of the user who sent the wallop
67
 	 * @param message The message
67
 	 * @param message The message
68
-         * @return true if a method was called, false otherwise
68
+	 * @return true if a method was called, false otherwise
69
 	 */
69
 	 */
70
 	protected boolean callWallop(final String message, final String host) {
70
 	protected boolean callWallop(final String message, final String host) {
71
-		return ((CallbackOnWallop) getCallbackManager()
72
-                .getCallbackType("OnWallop")).call(message, host);
71
+		return ((CallbackOnWallop) getCallbackManager().getCallbackType("OnWallop")).call(message, host);
73
 	}
72
 	}
74
 	
73
 	
75
 	/**
74
 	/**
78
 	 * @see IWalluser
77
 	 * @see IWalluser
79
 	 * @param host Host of the user who sent the walluser
78
 	 * @param host Host of the user who sent the walluser
80
 	 * @param message The message
79
 	 * @param message The message
81
-         * @return true if a method was called, false otherwise
80
+	 * @return true if a method was called, false otherwise
82
 	 */
81
 	 */
83
 	protected boolean callWalluser(final String message, final String host) {
82
 	protected boolean callWalluser(final String message, final String host) {
84
-		return ((CallbackOnWalluser) getCallbackManager()
85
-                .getCallbackType("OnWalluser")).call(message, host);
83
+		return ((CallbackOnWalluser) getCallbackManager().getCallbackType("OnWalluser")).call(message, host);
86
 	}
84
 	}
87
 	
85
 	
88
 	/**
86
 	/**
91
 	 * @see IWallDesync
89
 	 * @see IWallDesync
92
 	 * @param host Host of the user who sent the WallDesync
90
 	 * @param host Host of the user who sent the WallDesync
93
 	 * @param message The message
91
 	 * @param message The message
94
-         * @return true if a method was called, false otherwise
92
+	 * @return true if a method was called, false otherwise
95
 	 */
93
 	 */
96
 	protected boolean callWallDesync(final String message, final String host) {
94
 	protected boolean callWallDesync(final String message, final String host) {
97
-		return ((CallbackOnWallDesync) getCallbackManager()
98
-                .getCallbackType("OnWallDesync")).call(message, host);
95
+		return ((CallbackOnWallDesync) getCallbackManager().getCallbackType("OnWallDesync")).call(message, host);
99
 	}
96
 	}
100
 	
97
 	
101
 	
98
 	
104
 	 *
101
 	 *
105
 	 * @return String[] with the names of the tokens we handle.
102
 	 * @return String[] with the names of the tokens we handle.
106
 	 */
103
 	 */
107
-    @Override
104
+	@Override
108
 	public String[] handles() {
105
 	public String[] handles() {
109
-		String[] iHandle = new String[]{"WALLOPS"};
110
-		return iHandle;
106
+		return new String[]{"WALLOPS"};
111
 	} 
107
 	} 
112
 	
108
 	
113
 	/**
109
 	/**

+ 5
- 9
src/com/dmdirc/parser/ProcessWho.java View File

37
 	 * @param sParam Type of line to process ("352")
37
 	 * @param sParam Type of line to process ("352")
38
 	 * @param token IRCTokenised line to process
38
 	 * @param token IRCTokenised line to process
39
 	 */
39
 	 */
40
-    @Override
40
+	@Override
41
 	public void process(final String sParam, final String[] token) {
41
 	public void process(final String sParam, final String[] token) {
42
 		// :blueyonder2.uk.quakenet.org 352 Dataforce #mdbot shane Tobavaj.users.quakenet.org *.quakenet.org Tobavaj G+x :3 Tobavaj - http://shane.dmdirc.com/scriptbot.php
42
 		// :blueyonder2.uk.quakenet.org 352 Dataforce #mdbot shane Tobavaj.users.quakenet.org *.quakenet.org Tobavaj G+x :3 Tobavaj - http://shane.dmdirc.com/scriptbot.php
43
 		//              0               1      2        3     4              5                      6           7     8        9
43
 		//              0               1      2        3     4              5                      6           7     8        9
88
 	 * @return true if a method was called, false otherwise
88
 	 * @return true if a method was called, false otherwise
89
 	 */
89
 	 */
90
 	protected boolean callAwayStateOther(final ClientInfo client, final boolean state) {
90
 	protected boolean callAwayStateOther(final ClientInfo client, final boolean state) {
91
-		return ((CallbackOnAwayStateOther) myParser.getCallbackManager()
92
-                .getCallbackType("OnAwayStateOther")).call(client, state);
91
+		return ((CallbackOnAwayStateOther) myParser.getCallbackManager().getCallbackType("OnAwayStateOther")).call(client, state);
93
 	}
92
 	}
94
 	
93
 	
95
 	/**
94
 	/**
102
 	 * @return true if a method was called, false otherwise
101
 	 * @return true if a method was called, false otherwise
103
 	 */
102
 	 */
104
 	protected boolean callChannelAwayStateOther(final ChannelInfo channel, final ChannelClientInfo channelClient, final boolean state) {
103
 	protected boolean callChannelAwayStateOther(final ChannelInfo channel, final ChannelClientInfo channelClient, final boolean state) {
105
-		return ((CallbackOnChannelAwayStateOther) myParser.getCallbackManager()
106
-                .getCallbackType("OnChannelAwayStateOther")).call(channel, channelClient, state);
104
+		return ((CallbackOnChannelAwayStateOther) myParser.getCallbackManager().getCallbackType("OnChannelAwayStateOther")).call(channel, channelClient, state);
107
 	}
105
 	}
108
 	
106
 	
109
 	/**
107
 	/**
111
 	 *
109
 	 *
112
 	 * @return String[] with the names of the tokens we handle.
110
 	 * @return String[] with the names of the tokens we handle.
113
 	 */
111
 	 */
114
-    @Override
112
+	@Override
115
 	public String[] handles() {
113
 	public String[] handles() {
116
-		String[] iHandle = new String[1];
117
-		iHandle[0] = "352";
118
-		return iHandle;
114
+		return new String[]{"352"};
119
 	} 
115
 	} 
120
 	
116
 	
121
 	/**
117
 	/**

+ 1
- 2
src/com/dmdirc/parser/ProcessingManager.java View File

218
 	 * @return true if a method was called, false otherwise
218
 	 * @return true if a method was called, false otherwise
219
 	 */
219
 	 */
220
 	protected boolean callNumeric(final int numeric, final String[] token) {
220
 	protected boolean callNumeric(final int numeric, final String[] token) {
221
-		return ((CallbackOnNumeric) myParser.getCallbackManager()
222
-                .getCallbackType("OnNumeric")).call(numeric, token);
221
+		return ((CallbackOnNumeric) myParser.getCallbackManager().getCallbackType("OnNumeric")).call(numeric, token);
223
 	}
222
 	}
224
 
223
 
225
 }
224
 }

+ 6
- 6
src/com/dmdirc/parser/callbacks/CallbackManager.java View File

150
 		if (!callbackHash.containsKey(callbackName.toLowerCase())) {
150
 		if (!callbackHash.containsKey(callbackName.toLowerCase())) {
151
 			throw new CallbackNotFoundException("Callback not found: " + callbackName);
151
 			throw new CallbackNotFoundException("Callback not found: " + callbackName);
152
 		}
152
 		}
153
-        
153
+		
154
 		return callbackHash.get(callbackName.toLowerCase());
154
 		return callbackHash.get(callbackName.toLowerCase());
155
 	}
155
 	}
156
 	
156
 	
187
 	 */
187
 	 */
188
 	public void addCallback(final String callbackName, final ICallbackInterface o) throws CallbackNotFoundException {
188
 	public void addCallback(final String callbackName, final ICallbackInterface o) throws CallbackNotFoundException {
189
 		if (o == null) {
189
 		if (o == null) {
190
-            throw new NullPointerException("CallbackInterface is null");
191
-        }
192
-        
193
-        final CallbackObject cb = getCallbackType(callbackName);
190
+			throw new NullPointerException("CallbackInterface is null");
191
+		}
192
+		
193
+		final CallbackObject cb = getCallbackType(callbackName);
194
 		
194
 		
195
-        if (cb != null) { cb.add(o); }
195
+		if (cb != null) { cb.add(o); }
196
 	}
196
 	}
197
 	
197
 	
198
 	/**
198
 	/**

+ 1
- 2
src/com/dmdirc/parser/callbacks/CallbackObject.java View File

87
 	 * @return true if error call succeeded, false otherwise
87
 	 * @return true if error call succeeded, false otherwise
88
 	 */
88
 	 */
89
 	protected final boolean callErrorInfo(final ParserError errorInfo) {
89
 	protected final boolean callErrorInfo(final ParserError errorInfo) {
90
-		return ((CallbackOnErrorInfo) myManager
91
-                .getCallbackType("OnErrorInfo")).call(errorInfo);
90
+		return ((CallbackOnErrorInfo) myManager.getCallbackType("OnErrorInfo")).call(errorInfo);
92
 	}
91
 	}
93
 	
92
 	
94
 	/**
93
 	/**

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

60
 	 */
60
 	 */
61
 	protected boolean isValidChan(final ICallbackInterface eMethod, final ChannelInfo cChannel) {
61
 	protected boolean isValidChan(final ICallbackInterface eMethod, final ChannelInfo cChannel) {
62
 		if (specificData.containsKey(eMethod)) { 
62
 		if (specificData.containsKey(eMethod)) { 
63
-			if (!myParser.equalsIgnoreCase(cChannel.getName(), specificData.get(eMethod))) { return false; }
63
+			if (!myParser.getIRCStringConverter().equalsIgnoreCase(cChannel.getName(), specificData.get(eMethod))) { return false; }
64
 		}
64
 		}
65
 		return true;
65
 		return true;
66
 	}
66
 	}
75
 	protected boolean isValidUser(final ICallbackInterface eMethod, final String sHost) {
75
 	protected boolean isValidUser(final ICallbackInterface eMethod, final String sHost) {
76
 		final String nickname = ClientInfo.parseHost(sHost);
76
 		final String nickname = ClientInfo.parseHost(sHost);
77
 		if (specificData.containsKey(eMethod)) {
77
 		if (specificData.containsKey(eMethod)) {
78
-			if (!myParser.equalsIgnoreCase(nickname, specificData.get(eMethod))) { return false; }
78
+			if (!myParser.getIRCStringConverter().equalsIgnoreCase(nickname, specificData.get(eMethod))) { return false; }
79
 		}
79
 		}
80
 		return true;
80
 		return true;
81
 	}
81
 	}

Loading…
Cancel
Save