|
@@ -109,9 +109,9 @@ public class IRCParser implements SecureParser, EncodingParser, Runnable {
|
109
|
109
|
* Nickname here is *not* always accurate.<br><br>
|
110
|
110
|
* ClientInfo variable tParser.getMyself() should be used for accurate info.
|
111
|
111
|
*/
|
112
|
|
- public MyInfo me = new MyInfo();
|
|
112
|
+ private MyInfo me = new MyInfo();
|
113
|
113
|
/** Server Info requested by user. */
|
114
|
|
- public ServerInfo server;
|
|
114
|
+ private ServerInfo server;
|
115
|
115
|
/** The proxy to use to connect. */
|
116
|
116
|
private URI proxy;
|
117
|
117
|
/** Should PINGs be sent to the server to check if its alive? */
|
|
@@ -258,12 +258,10 @@ public class IRCParser implements SecureParser, EncodingParser, Runnable {
|
258
|
258
|
public void checkServerTrusted(final X509Certificate[] certs, final String authType) {
|
259
|
259
|
}
|
260
|
260
|
},};
|
261
|
|
- /** Should fake (channel)clients be created for callbacks where they do not exist? */
|
262
|
|
- private boolean createFake = true;
|
263
|
261
|
/** Should channels automatically request list modes? */
|
264
|
262
|
private boolean autoListMode = true;
|
265
|
263
|
/** Should part/quit/kick callbacks be fired before removing the user internally? */
|
266
|
|
- boolean removeAfterCallback = true;
|
|
264
|
+ private boolean removeAfterCallback = true;
|
267
|
265
|
/** This is the TrustManager used for SSL Sockets. */
|
268
|
266
|
private TrustManager[] myTrustManager = trustAllCerts;
|
269
|
267
|
/** The KeyManagers used for client certificates for SSL sockets. */
|
|
@@ -423,24 +421,6 @@ public class IRCParser implements SecureParser, EncodingParser, Runnable {
|
423
|
421
|
return myMap;
|
424
|
422
|
}
|
425
|
423
|
|
426
|
|
- /**
|
427
|
|
- * Get the current Value of createFake.
|
428
|
|
- *
|
429
|
|
- * @return Value of createFake (true if fake clients will be added for callbacks, else false)
|
430
|
|
- */
|
431
|
|
- public boolean getCreateFake() {
|
432
|
|
- return createFake;
|
433
|
|
- }
|
434
|
|
-
|
435
|
|
- /**
|
436
|
|
- * Set the current Value of createFake.
|
437
|
|
- *
|
438
|
|
- * @param newValue New value to set createFake
|
439
|
|
- */
|
440
|
|
- public void setCreateFake(final boolean newValue) {
|
441
|
|
- createFake = newValue;
|
442
|
|
- }
|
443
|
|
-
|
444
|
424
|
/**
|
445
|
425
|
* Get the current Value of autoListMode.
|
446
|
426
|
*
|
|
@@ -1191,6 +1171,16 @@ public class IRCParser implements SecureParser, EncodingParser, Runnable {
|
1191
|
1171
|
return serverName;
|
1192
|
1172
|
}
|
1193
|
1173
|
|
|
1174
|
+ /**
|
|
1175
|
+ * Gets the ServerInfo object that corresponds to the server that this
|
|
1176
|
+ * parser is configured to connect to.
|
|
1177
|
+ *
|
|
1178
|
+ * @return This parser's configured server info.
|
|
1179
|
+ */
|
|
1180
|
+ public ServerInfo getServerInfo() {
|
|
1181
|
+ return server;
|
|
1182
|
+ }
|
|
1183
|
+
|
1194
|
1184
|
/** {@inheritDoc} */
|
1195
|
1185
|
@Override
|
1196
|
1186
|
public String getLastLine() {
|
|
@@ -1360,33 +1350,6 @@ public class IRCParser implements SecureParser, EncodingParser, Runnable {
|
1360
|
1350
|
stringConverter = new IRCStringConverter(encoding);
|
1361
|
1351
|
}
|
1362
|
1352
|
|
1363
|
|
- /**
|
1364
|
|
- * Get the known boolean chanmodes in 005 order.
|
1365
|
|
- * Modes are returned in the order that the ircd specifies the modes in 005
|
1366
|
|
- * with any newly-found modes (mode being set that wasn't specified in 005)
|
1367
|
|
- * being added at the end.
|
1368
|
|
- *
|
1369
|
|
- * @return All the currently known boolean modes
|
1370
|
|
- */
|
1371
|
|
- public String getBoolChanModes005() {
|
1372
|
|
- // This code isn't the nicest, as Hashtable's don't lend themselves to being
|
1373
|
|
- // ordered.
|
1374
|
|
- // Order isn't really important, and this code only takes 3 lines of we
|
1375
|
|
- // don't care about it but ordered guarentees that on a specific ircd this
|
1376
|
|
- // method will ALWAYs return the same value.
|
1377
|
|
- final char[] modes = new char[chanModesBool.size()];
|
1378
|
|
-
|
1379
|
|
- for (Map.Entry<Character, Long> entry : chanModesBool.entrySet()) {
|
1380
|
|
- // nTemp should never be less than 0
|
1381
|
|
- if (entry.getValue() > 0) {
|
1382
|
|
- final double pos = Math.log(entry.getValue()) / Math.log(2);
|
1383
|
|
- modes[(int) pos] = entry.getKey();
|
1384
|
|
- }
|
1385
|
|
- }
|
1386
|
|
-
|
1387
|
|
- return new String(modes);
|
1388
|
|
- }
|
1389
|
|
-
|
1390
|
1353
|
/**
|
1391
|
1354
|
* Process CHANMODES from 005.
|
1392
|
1355
|
*/
|
|
@@ -1662,15 +1625,6 @@ public class IRCParser implements SecureParser, EncodingParser, Runnable {
|
1662
|
1625
|
h005Info.put("PREFIXSTRING", bits[0]);
|
1663
|
1626
|
}
|
1664
|
1627
|
|
1665
|
|
- /**
|
1666
|
|
- * Check if server is ready.
|
1667
|
|
- *
|
1668
|
|
- * @return true if 001 has been recieved, false otherwise.
|
1669
|
|
- */
|
1670
|
|
- public boolean isReady() {
|
1671
|
|
- return got001;
|
1672
|
|
- }
|
1673
|
|
-
|
1674
|
1628
|
/** {@inheritDoc} */
|
1675
|
1629
|
@Override
|
1676
|
1630
|
public void joinChannel(final String channel) {
|
|
@@ -2017,22 +1971,6 @@ public class IRCParser implements SecureParser, EncodingParser, Runnable {
|
2017
|
1971
|
return ServerType.findServerType(h005Info.get("004IRCD"), networkName, h005Info.get("003IRCD"), h005Info.get("002IRCD"));
|
2018
|
1972
|
}
|
2019
|
1973
|
|
2020
|
|
- /**
|
2021
|
|
- * Get the name of the ircd.
|
2022
|
|
- *
|
2023
|
|
- * @param getType if this is false the string from 004 is returned. Else a guess of the type (ircu, hybrid, ircnet)
|
2024
|
|
- * @return IRCD Version or Type
|
2025
|
|
- * @deprecated Use getServerSoftware() or getServerSoftwareType() instead.
|
2026
|
|
- */
|
2027
|
|
- @Deprecated
|
2028
|
|
- public String getIRCD(final boolean getType) {
|
2029
|
|
- if (getType) {
|
2030
|
|
- return getServerSoftwareType();
|
2031
|
|
- } else {
|
2032
|
|
- return getServerSoftware();
|
2033
|
|
- }
|
2034
|
|
- }
|
2035
|
|
-
|
2036
|
1974
|
/** {@inheritDoc} */
|
2037
|
1975
|
@Override
|
2038
|
1976
|
public String getServerSoftware() {
|
|
@@ -2241,6 +2179,16 @@ public class IRCParser implements SecureParser, EncodingParser, Runnable {
|
2241
|
2179
|
}
|
2242
|
2180
|
}
|
2243
|
2181
|
|
|
2182
|
+ /**
|
|
2183
|
+ * Retrieves the local user information that this parser was configured
|
|
2184
|
+ * with.
|
|
2185
|
+ *
|
|
2186
|
+ * @return This parser's local user configuration
|
|
2187
|
+ */
|
|
2188
|
+ public MyInfo getMyInfo() {
|
|
2189
|
+ return me;
|
|
2190
|
+ }
|
|
2191
|
+
|
2244
|
2192
|
/**
|
2245
|
2193
|
* Get the current username (Specified in MyInfo on construction).
|
2246
|
2194
|
* Get the username given in MyInfo
|