|
@@ -31,6 +31,7 @@ import com.dmdirc.parser.common.ParserError;
|
31
|
31
|
import com.dmdirc.parser.common.QueuePriority;
|
32
|
32
|
import com.dmdirc.parser.common.SRVRecord;
|
33
|
33
|
import com.dmdirc.parser.common.SystemEncoder;
|
|
34
|
+import com.dmdirc.parser.interfaces.ChannelInfo;
|
34
|
35
|
import com.dmdirc.parser.interfaces.Encoder;
|
35
|
36
|
import com.dmdirc.parser.interfaces.EncodingParser;
|
36
|
37
|
import com.dmdirc.parser.interfaces.SecureParser;
|
|
@@ -67,7 +68,6 @@ import java.util.Arrays;
|
67
|
68
|
import java.util.Collection;
|
68
|
69
|
import java.util.Collections;
|
69
|
70
|
import java.util.Date;
|
70
|
|
-import java.util.Deque;
|
71
|
71
|
import java.util.HashMap;
|
72
|
72
|
import java.util.LinkedList;
|
73
|
73
|
import java.util.List;
|
|
@@ -130,7 +130,7 @@ public class IRCParser extends BaseParser implements SecureParser, EncodingParse
|
130
|
130
|
/** Should PINGs be sent to the server to check if its alive? */
|
131
|
131
|
private boolean checkServerPing = true;
|
132
|
132
|
/** Timer for server ping. */
|
133
|
|
- private Timer pingTimer = null;
|
|
133
|
+ private Timer pingTimer;
|
134
|
134
|
/** Semaphore for access to pingTimer. */
|
135
|
135
|
private final Semaphore pingTimerSem = new Semaphore(1);
|
136
|
136
|
/** Is a ping needed? */
|
|
@@ -194,9 +194,9 @@ public class IRCParser extends BaseParser implements SecureParser, EncodingParse
|
194
|
194
|
*/
|
195
|
195
|
public final Map<Character, Byte> chanModesOther = new HashMap<>();
|
196
|
196
|
/** The last line of input received from the server */
|
197
|
|
- private ReadLine lastLine = null;
|
|
197
|
+ private ReadLine lastLine;
|
198
|
198
|
/** Should the lastline (where given) be appended to the "data" part of any onErrorInfo call? */
|
199
|
|
- private boolean addLastLine = false;
|
|
199
|
+ private boolean addLastLine;
|
200
|
200
|
/** Channel Prefixes (ie # + etc). */
|
201
|
201
|
private String chanPrefix = DEFAULT_CHAN_PREFIX;
|
202
|
202
|
/** Hashtable storing all known clients based on nickname (in lowercase). */
|
|
@@ -326,7 +326,8 @@ public class IRCParser extends BaseParser implements SecureParser, EncodingParse
|
326
|
326
|
// would do after connecting, so is not relevent.
|
327
|
327
|
return uri.getScheme().equalsIgnoreCase(oldURI.getScheme())
|
328
|
328
|
&& uri.getHost().equalsIgnoreCase(oldURI.getHost())
|
329
|
|
- && ((uri.getUserInfo() == null || uri.getUserInfo().isEmpty()) || uri.getUserInfo().equalsIgnoreCase((oldURI.getUserInfo() == null ? "" : oldURI.getUserInfo())))
|
|
329
|
+ && (uri.getUserInfo() == null || uri.getUserInfo().isEmpty()
|
|
330
|
+ || uri.getUserInfo().equalsIgnoreCase(oldURI.getUserInfo() == null ? "" : oldURI.getUserInfo()))
|
330
|
331
|
&& uri.getPort() == oldURI.getPort();
|
331
|
332
|
}
|
332
|
333
|
|
|
@@ -391,11 +392,11 @@ public class IRCParser extends BaseParser implements SecureParser, EncodingParse
|
391
|
392
|
|
392
|
393
|
String channelString = uri.getPath();
|
393
|
394
|
if (uri.getRawQuery() != null && !uri.getRawQuery().isEmpty()) {
|
394
|
|
- channelString += "?" + uri.getRawQuery();
|
|
395
|
+ channelString += '?' + uri.getRawQuery();
|
395
|
396
|
}
|
396
|
397
|
|
397
|
398
|
if (uri.getRawFragment() != null && !uri.getRawFragment().isEmpty()) {
|
398
|
|
- channelString += "#" + uri.getRawFragment();
|
|
399
|
+ channelString += '#' + uri.getRawFragment();
|
399
|
400
|
}
|
400
|
401
|
|
401
|
402
|
if (!channelString.isEmpty() && channelString.charAt(0) == '/') {
|
|
@@ -415,7 +416,7 @@ public class IRCParser extends BaseParser implements SecureParser, EncodingParse
|
415
|
416
|
* @return A corresponding collection of join request objects
|
416
|
417
|
*/
|
417
|
418
|
protected Collection<? extends ChannelJoinRequest> extractChannels(final String channels) {
|
418
|
|
- final List<ChannelJoinRequest> res = new ArrayList<>();
|
|
419
|
+ final Collection<ChannelJoinRequest> res = new ArrayList<>();
|
419
|
420
|
|
420
|
421
|
for (String channel : channels.split(",")) {
|
421
|
422
|
final String[] parts = channel.split(" ", 2);
|
|
@@ -558,7 +559,7 @@ public class IRCParser extends BaseParser implements SecureParser, EncodingParse
|
558
|
559
|
/**
|
559
|
560
|
* Callback to all objects implementing the ServerError Callback.
|
560
|
561
|
*
|
561
|
|
- * @see com.dmdirc.parser.interfaces.callbacks.ServerErrorListener
|
|
562
|
+ * @see ServerErrorListener
|
562
|
563
|
* @param message The error message
|
563
|
564
|
*/
|
564
|
565
|
protected void callServerError(final String message) {
|
|
@@ -568,7 +569,7 @@ public class IRCParser extends BaseParser implements SecureParser, EncodingParse
|
568
|
569
|
/**
|
569
|
570
|
* Callback to all objects implementing the DataIn Callback.
|
570
|
571
|
*
|
571
|
|
- * @see com.dmdirc.parser.interfaces.callbacks.DataInListener
|
|
572
|
+ * @see DataInListener
|
572
|
573
|
* @param data Incoming Line.
|
573
|
574
|
*/
|
574
|
575
|
protected void callDataIn(final String data) {
|
|
@@ -580,7 +581,7 @@ public class IRCParser extends BaseParser implements SecureParser, EncodingParse
|
580
|
581
|
*
|
581
|
582
|
* @param data Outgoing Data
|
582
|
583
|
* @param fromParser True if parser sent the data, false if sent using .sendLine
|
583
|
|
- * @see com.dmdirc.parser.interfaces.callbacks.DataOutListener
|
|
584
|
+ * @see DataOutListener
|
584
|
585
|
*/
|
585
|
586
|
protected void callDataOut(final String data, final boolean fromParser) {
|
586
|
587
|
getCallback(DataOutListener.class).onDataOut(null, null, data, fromParser);
|
|
@@ -589,7 +590,7 @@ public class IRCParser extends BaseParser implements SecureParser, EncodingParse
|
589
|
590
|
/**
|
590
|
591
|
* Callback to all objects implementing the DebugInfo Callback.
|
591
|
592
|
*
|
592
|
|
- * @see com.dmdirc.parser.interfaces.callbacks.DebugInfoListener
|
|
593
|
+ * @see DebugInfoListener
|
593
|
594
|
* @param level Debugging Level (DEBUG_INFO, DEBUG_SOCKET etc)
|
594
|
595
|
* @param data Debugging Information as a format string
|
595
|
596
|
* @param args Formatting String Options
|
|
@@ -601,7 +602,7 @@ public class IRCParser extends BaseParser implements SecureParser, EncodingParse
|
601
|
602
|
/**
|
602
|
603
|
* Callback to all objects implementing the DebugInfo Callback.
|
603
|
604
|
*
|
604
|
|
- * @see com.dmdirc.parser.interfaces.callbacks.DebugInfoListener
|
|
605
|
+ * @see DebugInfoListener
|
605
|
606
|
* @param level Debugging Level (DEBUG_INFO, DEBUG_SOCKET etc)
|
606
|
607
|
* @param data Debugging Information
|
607
|
608
|
*/
|
|
@@ -612,7 +613,7 @@ public class IRCParser extends BaseParser implements SecureParser, EncodingParse
|
612
|
613
|
/**
|
613
|
614
|
* Callback to all objects implementing the IErrorInfo Interface.
|
614
|
615
|
*
|
615
|
|
- * @see com.dmdirc.parser.interfaces.callbacks.ErrorInfoListener
|
|
616
|
+ * @see ErrorInfoListener
|
616
|
617
|
* @param errorInfo ParserError object representing the error.
|
617
|
618
|
*/
|
618
|
619
|
public void callErrorInfo(final ParserError errorInfo) {
|
|
@@ -622,7 +623,7 @@ public class IRCParser extends BaseParser implements SecureParser, EncodingParse
|
622
|
623
|
/**
|
623
|
624
|
* Callback to all objects implementing the IConnectError Interface.
|
624
|
625
|
*
|
625
|
|
- * @see com.dmdirc.parser.interfaces.callbacks.ConnectErrorListener
|
|
626
|
+ * @see ConnectErrorListener
|
626
|
627
|
* @param errorInfo ParserError object representing the error.
|
627
|
628
|
*/
|
628
|
629
|
protected void callConnectError(final ParserError errorInfo) {
|
|
@@ -632,7 +633,7 @@ public class IRCParser extends BaseParser implements SecureParser, EncodingParse
|
632
|
633
|
/**
|
633
|
634
|
* Callback to all objects implementing the SocketClosed Callback.
|
634
|
635
|
*
|
635
|
|
- * @see com.dmdirc.parser.interfaces.callbacks.SocketCloseListener
|
|
636
|
+ * @see SocketCloseListener
|
636
|
637
|
*/
|
637
|
638
|
protected void callSocketClosed() {
|
638
|
639
|
getCallback(SocketCloseListener.class).onSocketClosed(null, null);
|
|
@@ -641,7 +642,7 @@ public class IRCParser extends BaseParser implements SecureParser, EncodingParse
|
641
|
642
|
/**
|
642
|
643
|
* Callback to all objects implementing the PingFailed Callback.
|
643
|
644
|
*
|
644
|
|
- * @see com.dmdirc.parser.interfaces.callbacks.PingFailureListener
|
|
645
|
+ * @see PingFailureListener
|
645
|
646
|
* @return True if any callback was called, false otherwise.
|
646
|
647
|
*/
|
647
|
648
|
protected boolean callPingFailed() {
|
|
@@ -651,7 +652,7 @@ public class IRCParser extends BaseParser implements SecureParser, EncodingParse
|
651
|
652
|
/**
|
652
|
653
|
* Callback to all objects implementing the PingSent Callback.
|
653
|
654
|
*
|
654
|
|
- * @see com.dmdirc.parser.interfaces.callbacks.PingSentListener
|
|
655
|
+ * @see PingSentListener
|
655
|
656
|
*/
|
656
|
657
|
protected void callPingSent() {
|
657
|
658
|
getCallback(PingSentListener.class).onPingSent(null, null);
|
|
@@ -660,7 +661,7 @@ public class IRCParser extends BaseParser implements SecureParser, EncodingParse
|
660
|
661
|
/**
|
661
|
662
|
* Callback to all objects implementing the PingSuccess Callback.
|
662
|
663
|
*
|
663
|
|
- * @see com.dmdirc.parser.interfaces.callbacks.PingSuccessListener
|
|
664
|
+ * @see PingSuccessListener
|
664
|
665
|
*/
|
665
|
666
|
protected void callPingSuccess() {
|
666
|
667
|
getCallback(PingSuccessListener.class).onPingSuccess(null, null);
|
|
@@ -669,7 +670,7 @@ public class IRCParser extends BaseParser implements SecureParser, EncodingParse
|
669
|
670
|
/**
|
670
|
671
|
* Callback to all objects implementing the Post005 Callback.
|
671
|
672
|
*
|
672
|
|
- * @see com.dmdirc.parser.interfaces.callbacks.ServerReadyListener
|
|
673
|
+ * @see ServerReadyListener
|
673
|
674
|
*/
|
674
|
675
|
protected synchronized void callPost005() {
|
675
|
676
|
if (post005) {
|
|
@@ -807,7 +808,8 @@ public class IRCParser extends BaseParser implements SecureParser, EncodingParse
|
807
|
808
|
} else {
|
808
|
809
|
callDebugInfo(DEBUG_SOCKET, "Using Proxy");
|
809
|
810
|
|
810
|
|
- if ((getBindIP() != null && !getBindIP().isEmpty()) || (getBindIPv6() != null && !getBindIPv6().isEmpty())) {
|
|
811
|
+ if (getBindIP() != null && !getBindIP().isEmpty() ||
|
|
812
|
+ getBindIPv6() != null && !getBindIPv6().isEmpty()) {
|
811
|
813
|
callDebugInfo(DEBUG_SOCKET, "IP Binding is not possible when using a proxy.");
|
812
|
814
|
}
|
813
|
815
|
|
|
@@ -941,7 +943,7 @@ public class IRCParser extends BaseParser implements SecureParser, EncodingParse
|
941
|
943
|
}
|
942
|
944
|
|
943
|
945
|
resetState();
|
944
|
|
- callDebugInfo(DEBUG_SOCKET, "Connecting to " + getURI().getHost() + ":" + getURI().getPort());
|
|
946
|
+ callDebugInfo(DEBUG_SOCKET, "Connecting to " + getURI().getHost() + ':' + getURI().getPort());
|
945
|
947
|
|
946
|
948
|
currentSocketState = SocketState.OPENING;
|
947
|
949
|
socket = findSocket(getConnectURI(getURI()), getProxy());
|
|
@@ -996,7 +998,7 @@ public class IRCParser extends BaseParser implements SecureParser, EncodingParse
|
996
|
998
|
} catch (UnknownHostException uhe) {
|
997
|
999
|
localhost = "*";
|
998
|
1000
|
}
|
999
|
|
- sendString("USER " + me.getUsername() + " " + localhost + " " + getURI().getHost() + " :" + me.getRealname());
|
|
1001
|
+ sendString("USER " + me.getUsername() + ' ' + localhost + ' ' + getURI().getHost() + " :" + me.getRealname());
|
1000
|
1002
|
}
|
1001
|
1003
|
|
1002
|
1004
|
/**
|
|
@@ -1162,7 +1164,7 @@ public class IRCParser extends BaseParser implements SecureParser, EncodingParse
|
1162
|
1164
|
|
1163
|
1165
|
@Override
|
1164
|
1166
|
public void sendInvite(final String channel, final String user) {
|
1165
|
|
- sendRawMessage("INVITE " + user + " " + channel);
|
|
1167
|
+ sendRawMessage("INVITE " + user + ' ' + channel);
|
1166
|
1168
|
}
|
1167
|
1169
|
|
1168
|
1170
|
@Override
|
|
@@ -1231,7 +1233,7 @@ public class IRCParser extends BaseParser implements SecureParser, EncodingParse
|
1231
|
1233
|
if (channel != null) {
|
1232
|
1234
|
// This makes sure we don't add the same item to the LMQ twice,
|
1233
|
1235
|
// even if its requested twice, as the ircd will only reply once
|
1234
|
|
- final Deque<Character> foundModes = new LinkedList<>();
|
|
1236
|
+ final Queue<Character> foundModes = new LinkedList<>();
|
1235
|
1237
|
final Queue<Character> listModeQueue = channel.getListModeQueue();
|
1236
|
1238
|
for (int i = 0; i < newLine[2].length(); ++i) {
|
1237
|
1239
|
final Character mode = newLine[2].charAt(i);
|
|
@@ -1288,7 +1290,6 @@ public class IRCParser extends BaseParser implements SecureParser, EncodingParse
|
1288
|
1290
|
} catch (final NumberFormatException nfe) { /* Do nothing. */ }
|
1289
|
1291
|
}
|
1290
|
1292
|
|
1291
|
|
- int nParam;
|
1292
|
1293
|
setPingNeeded(false);
|
1293
|
1294
|
|
1294
|
1295
|
if (token.length < 2) {
|
|
@@ -1297,32 +1298,34 @@ public class IRCParser extends BaseParser implements SecureParser, EncodingParse
|
1297
|
1298
|
|
1298
|
1299
|
try {
|
1299
|
1300
|
final String sParam = token[1];
|
1300
|
|
- if (token[0].equalsIgnoreCase("PING") || token[1].equalsIgnoreCase("PING")) {
|
|
1301
|
+ if ("PING".equalsIgnoreCase(token[0]) || "PING".equalsIgnoreCase(token[1])) {
|
1301
|
1302
|
sendString("PONG :" + sParam, QueuePriority.HIGH);
|
1302
|
|
- } else if (token[0].equalsIgnoreCase("PONG") || token[1].equalsIgnoreCase("PONG")) {
|
|
1303
|
+ } else if ("PONG".equalsIgnoreCase(token[0]) || "PONG".equalsIgnoreCase(token[1])) {
|
1303
|
1304
|
if (!lastPingValue.isEmpty() && lastPingValue.equals(token[token.length - 1])) {
|
1304
|
1305
|
lastPingValue = "";
|
1305
|
1306
|
serverLag = System.currentTimeMillis() - pingTime;
|
1306
|
1307
|
callPingSuccess();
|
1307
|
1308
|
}
|
1308
|
|
- } else if (token[0].equalsIgnoreCase("ERROR")) {
|
|
1309
|
+ } else if ("ERROR".equalsIgnoreCase(token[0])) {
|
1309
|
1310
|
final StringBuilder errorMessage = new StringBuilder();
|
1310
|
1311
|
for (int i = 1; i < token.length; ++i) {
|
1311
|
1312
|
errorMessage.append(token[i]);
|
1312
|
1313
|
}
|
1313
|
1314
|
callServerError(errorMessage.toString());
|
1314
|
|
- } else if (token[1].equalsIgnoreCase("TSIRC") && token.length > 3) {
|
1315
|
|
- if (token[2].equals("1")) {
|
|
1315
|
+ } else if ("TSIRC".equalsIgnoreCase(token[1]) && token.length > 3) {
|
|
1316
|
+ if ("1".equals(token[2])) {
|
1316
|
1317
|
try {
|
1317
|
1318
|
final long ts = Long.parseLong(token[3]);
|
1318
|
1319
|
tsdiff = ts - System.currentTimeMillis();
|
1319
|
1320
|
} catch (final NumberFormatException nfe) { /* Do nothing. */ }
|
1320
|
1321
|
}
|
1321
|
1322
|
} else {
|
|
1323
|
+ int nParam;
|
1322
|
1324
|
if (got001) {
|
1323
|
1325
|
// Freenode sends a random notice in a stupid place, others might do aswell
|
1324
|
1326
|
// These shouldn't cause post005 to be fired, so handle them here.
|
1325
|
|
- if (token[0].equalsIgnoreCase("NOTICE") || (token.length > 2 && token[2].equalsIgnoreCase("NOTICE"))) {
|
|
1327
|
+ if ("NOTICE".equalsIgnoreCase(token[0]) ||
|
|
1328
|
+ token.length > 2 && "NOTICE".equalsIgnoreCase(token[2])) {
|
1326
|
1329
|
try {
|
1327
|
1330
|
myProcessingManager.process(lineTS, "Notice Auth", token);
|
1328
|
1331
|
} catch (ProcessorNotFoundException e) {
|
|
@@ -1385,12 +1388,12 @@ public class IRCParser extends BaseParser implements SecureParser, EncodingParse
|
1385
|
1388
|
}
|
1386
|
1389
|
// Some networks may send a NICK message if you nick change before 001
|
1387
|
1390
|
// Eat it up so that it isn't treated as a notice auth.
|
1388
|
|
- if (token[1].equalsIgnoreCase("NICK")) {
|
|
1391
|
+ if ("NICK".equalsIgnoreCase(token[1])) {
|
1389
|
1392
|
break;
|
1390
|
1393
|
}
|
1391
|
1394
|
|
1392
|
1395
|
// CAP also happens here, so try that.
|
1393
|
|
- if (token[1].equalsIgnoreCase("CAP")) {
|
|
1396
|
+ if ("CAP".equalsIgnoreCase(token[1])) {
|
1394
|
1397
|
myProcessingManager.process(lineTS, sParam, token);
|
1395
|
1398
|
break;
|
1396
|
1399
|
}
|
|
@@ -1412,7 +1415,7 @@ public class IRCParser extends BaseParser implements SecureParser, EncodingParse
|
1412
|
1415
|
}
|
1413
|
1416
|
|
1414
|
1417
|
/** The IRCStringConverter for this parser */
|
1415
|
|
- private IRCStringConverter stringConverter = null;
|
|
1418
|
+ private IRCStringConverter stringConverter;
|
1416
|
1419
|
|
1417
|
1420
|
@Override
|
1418
|
1421
|
public IRCStringConverter getStringConverter() {
|
|
@@ -1488,18 +1491,16 @@ public class IRCParser extends BaseParser implements SecureParser, EncodingParse
|
1488
|
1491
|
*/
|
1489
|
1492
|
public void parseChanModes() {
|
1490
|
1493
|
final StringBuilder sDefaultModes = new StringBuilder("b,k,l,");
|
1491
|
|
- String[] bits;
|
1492
|
1494
|
String modeStr;
|
1493
|
1495
|
if (h005Info.containsKey("USERCHANMODES")) {
|
1494
|
1496
|
if (getServerType() == ServerType.DANCER) {
|
1495
|
1497
|
sDefaultModes.insert(0, "dqeI");
|
1496
|
1498
|
} else if (getServerType() == ServerType.AUSTIRC) {
|
1497
|
|
- sDefaultModes.insert(0, "e");
|
|
1499
|
+ sDefaultModes.insert(0, 'e');
|
1498
|
1500
|
}
|
1499
|
1501
|
modeStr = h005Info.get("USERCHANMODES");
|
1500
|
|
- char mode;
|
1501
|
1502
|
for (int i = 0; i < modeStr.length(); ++i) {
|
1502
|
|
- mode = modeStr.charAt(i);
|
|
1503
|
+ final char mode = modeStr.charAt(i);
|
1503
|
1504
|
if (!prefixModes.isPrefixMode(mode)
|
1504
|
1505
|
&& sDefaultModes.indexOf(Character.toString(mode)) < 0) {
|
1505
|
1506
|
sDefaultModes.append(mode);
|
|
@@ -1514,7 +1515,7 @@ public class IRCParser extends BaseParser implements SecureParser, EncodingParse
|
1514
|
1515
|
modeStr = sDefaultModes.toString();
|
1515
|
1516
|
h005Info.put("CHANMODES", modeStr);
|
1516
|
1517
|
}
|
1517
|
|
- bits = modeStr.split(",", 5);
|
|
1518
|
+ String[] bits = modeStr.split(",", 5);
|
1518
|
1519
|
if (bits.length < 4) {
|
1519
|
1520
|
modeStr = sDefaultModes.toString();
|
1520
|
1521
|
callErrorInfo(new ParserError(ParserError.ERROR_ERROR, "CHANMODES String not valid. " +
|
|
@@ -1614,10 +1615,9 @@ public class IRCParser extends BaseParser implements SecureParser, EncodingParse
|
1614
|
1615
|
*/
|
1615
|
1616
|
protected String getOtherModeString(final byte value) {
|
1616
|
1617
|
final char[] modes = new char[chanModesOther.size()];
|
1617
|
|
- Byte nTemp;
|
1618
|
1618
|
int i = 0;
|
1619
|
1619
|
for (char cTemp : chanModesOther.keySet()) {
|
1620
|
|
- nTemp = chanModesOther.get(cTemp);
|
|
1620
|
+ final Byte nTemp = chanModesOther.get(cTemp);
|
1621
|
1621
|
if (nTemp == value) {
|
1622
|
1622
|
modes[i] = cTemp;
|
1623
|
1623
|
i++;
|
|
@@ -1641,11 +1641,11 @@ public class IRCParser extends BaseParser implements SecureParser, EncodingParse
|
1641
|
1641
|
* Process USERMODES from 004.
|
1642
|
1642
|
*/
|
1643
|
1643
|
public void parseUserModes() {
|
1644
|
|
- final String sDefaultModes = "nwdoi";
|
1645
|
1644
|
final String modeStr;
|
1646
|
1645
|
if (h005Info.containsKey("USERMODES")) {
|
1647
|
1646
|
modeStr = h005Info.get("USERMODES");
|
1648
|
1647
|
} else {
|
|
1648
|
+ final String sDefaultModes = "nwdoi";
|
1649
|
1649
|
modeStr = sDefaultModes;
|
1650
|
1650
|
h005Info.put("USERMODES", sDefaultModes);
|
1651
|
1651
|
}
|
|
@@ -1757,7 +1757,7 @@ public class IRCParser extends BaseParser implements SecureParser, EncodingParse
|
1757
|
1757
|
if (thisKey == null || thisKey.isEmpty()) {
|
1758
|
1758
|
sendString("JOIN " + channelString);
|
1759
|
1759
|
} else {
|
1760
|
|
- sendString("JOIN " + channelString + " " + thisKey);
|
|
1760
|
+ sendString("JOIN " + channelString + ' ' + thisKey);
|
1761
|
1761
|
}
|
1762
|
1762
|
}
|
1763
|
1763
|
}
|
|
@@ -1832,21 +1832,23 @@ public class IRCParser extends BaseParser implements SecureParser, EncodingParse
|
1832
|
1832
|
// MAXLIST=bdeI:50
|
1833
|
1833
|
// MAXLIST=b:60,e:60,I:60
|
1834
|
1834
|
// MAXBANS=30
|
1835
|
|
- int result = -2;
|
1836
|
1835
|
callDebugInfo(DEBUG_INFO, "Looking for maxlistmodes for: " + mode);
|
1837
|
1836
|
// Try in MAXLIST
|
|
1837
|
+ int result = -2;
|
1838
|
1838
|
if (h005Info.get("MAXLIST") != null) {
|
1839
|
1839
|
if (h005Info.get("MAXBANS") == null) {
|
1840
|
1840
|
result = 0;
|
1841
|
1841
|
}
|
1842
|
1842
|
final String maxlist = h005Info.get("MAXLIST");
|
1843
|
|
- callDebugInfo(DEBUG_INFO, "Found maxlist (" + maxlist + ")");
|
|
1843
|
+ callDebugInfo(DEBUG_INFO, "Found maxlist (" + maxlist + ')');
|
1844
|
1844
|
final String[] bits = maxlist.split(",");
|
1845
|
1845
|
for (String bit : bits) {
|
1846
|
1846
|
final String[] parts = bit.split(":", 2);
|
1847
|
|
- callDebugInfo(DEBUG_INFO, "Bit: " + bit + " | parts.length = " + parts.length + " (" + parts[0] + " -> " + parts[0].indexOf(mode) + ")");
|
|
1847
|
+ callDebugInfo(DEBUG_INFO, "Bit: " + bit + " | parts.length = " + parts.length + " ("
|
|
1848
|
+ + parts[0] + " -> " + parts[0].indexOf(mode) + ')');
|
1848
|
1849
|
if (parts.length == 2 && parts[0].indexOf(mode) > -1) {
|
1849
|
|
- callDebugInfo(DEBUG_INFO, "parts[0] = '" + parts[0] + "' | parts[1] = '" + parts[1] + "'");
|
|
1850
|
+ callDebugInfo(DEBUG_INFO, "parts[0] = '" + parts[0] + "' | parts[1] = '"
|
|
1851
|
+ + parts[1] + '\'');
|
1850
|
1852
|
try {
|
1851
|
1853
|
result = Integer.parseInt(parts[1]);
|
1852
|
1854
|
break;
|
|
@@ -1916,7 +1918,7 @@ public class IRCParser extends BaseParser implements SecureParser, EncodingParse
|
1916
|
1918
|
return;
|
1917
|
1919
|
}
|
1918
|
1920
|
final char char1 = (char) 1;
|
1919
|
|
- sendString("PRIVMSG " + target, char1 + type.toUpperCase() + " " + message + char1);
|
|
1921
|
+ sendString("PRIVMSG " + target, char1 + type.toUpperCase() + ' ' + message + char1);
|
1920
|
1922
|
}
|
1921
|
1923
|
|
1922
|
1924
|
@Override
|
|
@@ -1928,7 +1930,7 @@ public class IRCParser extends BaseParser implements SecureParser, EncodingParse
|
1928
|
1930
|
return;
|
1929
|
1931
|
}
|
1930
|
1932
|
final char char1 = (char) 1;
|
1931
|
|
- sendString("NOTICE " + target, char1 + type.toUpperCase() + " " + message + char1);
|
|
1933
|
+ sendString("NOTICE " + target, char1 + type.toUpperCase() + ' ' + message + char1);
|
1932
|
1934
|
}
|
1933
|
1935
|
|
1934
|
1936
|
@Override
|
|
@@ -2316,7 +2318,7 @@ public class IRCParser extends BaseParser implements SecureParser, EncodingParse
|
2316
|
2318
|
*
|
2317
|
2319
|
* @param channel Channel to remove
|
2318
|
2320
|
*/
|
2319
|
|
- public void removeChannel(final IRCChannelInfo channel) {
|
|
2321
|
+ public void removeChannel(final ChannelInfo channel) {
|
2320
|
2322
|
synchronized (channelList) {
|
2321
|
2323
|
channelList.remove(getStringConverter().toLowerCase(channel.getName()));
|
2322
|
2324
|
}
|