|
@@ -61,7 +61,7 @@ public class IRCChannelInfo implements ChannelInfo {
|
61
|
61
|
/** Has this channel ever had a topic? */
|
62
|
62
|
private boolean hadTopic;
|
63
|
63
|
/** Known boolean-modes for channel. */
|
64
|
|
- private long modes;
|
|
64
|
+ private String modes;
|
65
|
65
|
/** Reference to the parser object that owns this channel, Used for modes. */
|
66
|
66
|
private final IRCParser parser; // Reference to parser object that owns this channel. Used for Modes
|
67
|
67
|
/** Channel Name. */
|
|
@@ -76,9 +76,9 @@ public class IRCChannelInfo implements ChannelInfo {
|
76
|
76
|
* LinkedList storing status of mode adding.
|
77
|
77
|
* if an item is in this list for a mode, we are expecting new items for the list
|
78
|
78
|
*/
|
79
|
|
- private final List<Character> addingModes = new LinkedList<>();
|
|
79
|
+ private final Collection<Character> addingModes = new LinkedList<>();
|
80
|
80
|
/** Modes waiting to be sent to the server. */
|
81
|
|
- private final List<String> modeQueue = new LinkedList<>();
|
|
81
|
+ private final Collection<String> modeQueue = new LinkedList<>();
|
82
|
82
|
/** A Map to allow applications to attach misc data to this object. */
|
83
|
83
|
private final Map<Object, Object> map;
|
84
|
84
|
/** Queue of requested list modes. */
|
|
@@ -426,20 +426,20 @@ public class IRCChannelInfo implements ChannelInfo {
|
426
|
426
|
}
|
427
|
427
|
|
428
|
428
|
/**
|
429
|
|
- * Set the channel modes (as an integer).
|
|
429
|
+ * Set the channel modes.
|
430
|
430
|
*
|
431
|
|
- * @param nNewMode new long representing channel modes. (Boolean only)
|
|
431
|
+ * @param nNewMode new boolean channel modes
|
432
|
432
|
*/
|
433
|
|
- public void setMode(final long nNewMode) {
|
|
433
|
+ public void setMode(final String nNewMode) {
|
434
|
434
|
modes = nNewMode;
|
435
|
435
|
}
|
436
|
436
|
|
437
|
437
|
/**
|
438
|
|
- * Get the channel modes (as an integer).
|
|
438
|
+ * Get the channel modes.
|
439
|
439
|
*
|
440
|
|
- * @return long representing channel modes. (Boolean only)
|
|
440
|
+ * @return the boolean channel modes.
|
441
|
441
|
*/
|
442
|
|
- public long getMode() {
|
|
442
|
+ public String getMode() {
|
443
|
443
|
return modes;
|
444
|
444
|
}
|
445
|
445
|
|
|
@@ -447,17 +447,9 @@ public class IRCChannelInfo implements ChannelInfo {
|
447
|
447
|
public String getModes() {
|
448
|
448
|
final StringBuilder sModes = new StringBuilder("+");
|
449
|
449
|
final StringBuilder sModeParams = new StringBuilder();
|
450
|
|
- String sTemp;
|
451
|
|
- long nTemp;
|
452
|
|
- final long nChanModes = this.getMode();
|
453
|
|
- for (char cTemp : parser.chanModesBool.keySet()) {
|
454
|
|
- nTemp = parser.chanModesBool.get(cTemp);
|
455
|
|
- if ((nChanModes & nTemp) == nTemp) {
|
456
|
|
- sModes.append(cTemp);
|
457
|
|
- }
|
458
|
|
- }
|
|
450
|
+ sModes.append(modes);
|
459
|
451
|
for (char cTemp : paramModes.keySet()) {
|
460
|
|
- sTemp = paramModes.get(cTemp);
|
|
452
|
+ final String sTemp = paramModes.get(cTemp);
|
461
|
453
|
if (!sTemp.isEmpty()) {
|
462
|
454
|
sModes.append(cTemp);
|
463
|
455
|
sModeParams.append(' ').append(this.getMode(cTemp));
|
|
@@ -613,7 +605,7 @@ public class IRCChannelInfo implements ChannelInfo {
|
613
|
605
|
}
|
614
|
606
|
|
615
|
607
|
modestr = (add ? "+" : "-") + mode;
|
616
|
|
- if (parser.chanModesBool.containsKey(mode)) {
|
|
608
|
+ if (parser.chanModesBool.isMode(mode)) {
|
617
|
609
|
final String teststr = (add ? "-" : "+") + mode;
|
618
|
610
|
if (modeQueue.contains(teststr)) {
|
619
|
611
|
modeQueue.remove(teststr);
|
|
@@ -629,9 +621,9 @@ public class IRCChannelInfo implements ChannelInfo {
|
629
|
621
|
modeint = parser.chanModesOther.get(mode);
|
630
|
622
|
if ((modeint & IRCParser.MODE_LIST) == IRCParser.MODE_LIST) {
|
631
|
623
|
modestr = modestr + " " + parameter;
|
632
|
|
- } else if (!add && ((modeint & IRCParser.MODE_UNSET) == IRCParser.MODE_UNSET)) {
|
|
624
|
+ } else if (!add && (modeint & IRCParser.MODE_UNSET) == IRCParser.MODE_UNSET) {
|
633
|
625
|
modestr = modestr + " " + parameter;
|
634
|
|
- } else if (add && ((modeint & IRCParser.MODE_SET) == IRCParser.MODE_SET)) {
|
|
626
|
+ } else if (add && (modeint & IRCParser.MODE_SET) == IRCParser.MODE_SET) {
|
635
|
627
|
// Does mode require a param to unset aswell?
|
636
|
628
|
// We might need to queue an unset first
|
637
|
629
|
if ((modeint & IRCParser.MODE_UNSET) == IRCParser.MODE_UNSET) {
|