|
@@ -679,9 +679,6 @@ public class IRCParser extends BaseParser implements SecureParser, EncodingParse
|
679
|
679
|
|
680
|
680
|
post005 = true;
|
681
|
681
|
|
682
|
|
- if (!h005Info.containsKey("CHANTYPES")) {
|
683
|
|
- parseChanPrefix();
|
684
|
|
- }
|
685
|
682
|
if (!h005Info.containsKey("PREFIX")) {
|
686
|
683
|
parsePrefixModes();
|
687
|
684
|
}
|
|
@@ -1665,14 +1662,19 @@ public class IRCParser extends BaseParser implements SecureParser, EncodingParse
|
1665
|
1662
|
}
|
1666
|
1663
|
|
1667
|
1664
|
/**
|
1668
|
|
- * Process CHANTYPES from 005.
|
|
1665
|
+ * Resets the channel prefix property to the default, RFC specified value.
|
1669
|
1666
|
*/
|
1670
|
|
- protected void parseChanPrefix() {
|
1671
|
|
- if (h005Info.containsKey("CHANTYPES") && !h005Info.get("CHANTYPES").isEmpty()) {
|
1672
|
|
- chanPrefix = h005Info.get("CHANTYPES");
|
1673
|
|
- } else {
|
1674
|
|
- h005Info.put("CHANTYPES", DEFAULT_CHAN_PREFIX);
|
1675
|
|
- }
|
|
1667
|
+ protected void resetChanPrefix() {
|
|
1668
|
+ chanPrefix = DEFAULT_CHAN_PREFIX;
|
|
1669
|
+ }
|
|
1670
|
+
|
|
1671
|
+ /**
|
|
1672
|
+ * Sets the set of possible channel prefixes to those in the given value.
|
|
1673
|
+ *
|
|
1674
|
+ * @param value The new set of channel prefixes.
|
|
1675
|
+ */
|
|
1676
|
+ protected void setChanPrefix(final String value) {
|
|
1677
|
+ chanPrefix = value;
|
1676
|
1678
|
}
|
1677
|
1679
|
|
1678
|
1680
|
/**
|
|
@@ -1745,15 +1747,12 @@ public class IRCParser extends BaseParser implements SecureParser, EncodingParse
|
1745
|
1747
|
list.append(',');
|
1746
|
1748
|
}
|
1747
|
1749
|
if (!isValidChannelName(channel.getName())) {
|
1748
|
|
- if (h005Info.containsKey("CHANTYPES")) {
|
1749
|
|
- final String chantypes = h005Info.get("CHANTYPES");
|
1750
|
|
- if (chantypes.isEmpty()) {
|
1751
|
|
- list.append('#');
|
1752
|
|
- } else {
|
1753
|
|
- list.append(chantypes.charAt(0));
|
1754
|
|
- }
|
1755
|
|
- } else {
|
|
1750
|
+ if (chanPrefix.isEmpty()) {
|
|
1751
|
+ // TODO: This is wrong - empty chan prefix means the
|
|
1752
|
+ // IRCd supports no channels.
|
1756
|
1753
|
list.append('#');
|
|
1754
|
+ } else {
|
|
1755
|
+ list.append(chanPrefix.charAt(0));
|
1757
|
1756
|
}
|
1758
|
1757
|
}
|
1759
|
1758
|
list.append(channel.getName());
|