Bladeren bron

Fixes issue 2742 (Austhex uses +q and +a)

Fixes issue 2743 (Austhex now calls itself 8.1.6)
Fixes issue 2745 (Austirc is now IRSee)
Fixes issue 2739 (Support for ircd-seven)
Fixes issue 2740 (Support for ircd-rizon)
Fixes issue 3178 (Plexus +eI)
Fixes issue 3044 (Austhex +eI)

Change-Id: Ib35c724607e4167f572201fcd322ad9533f3eaa2
Reviewed-on: http://gerrit.dmdirc.com/428
Reviewed-by: Chris Smith <chris@dmdirc.com>
Tested-by: Chris Smith <chris@dmdirc.com>
tags/0.6.3
Shane Mc Cormack 14 jaren geleden
bovenliggende
commit
1e72836479

+ 3
- 3
src/com/dmdirc/parser/irc/IRCChannelInfo.java Bestand weergeven

@@ -148,7 +148,7 @@ public class IRCChannelInfo implements ChannelInfo {
148 148
         final boolean isOpped = me.getImportantModeValue() > voiceValue;
149 149
         
150 150
         int modecount = 1;
151
-        if (serverType != ServerType.UNREAL && myParser.h005Info.containsKey("MODES")) {
151
+        if (serverType != ServerType.UNREAL && serverType != ServerType.IRSEE && myParser.h005Info.containsKey("MODES")) {
152 152
             try {
153 153
                 modecount = Integer.parseInt(myParser.h005Info.get("MODES"));
154 154
             } catch (NumberFormatException e) { /* use default modecount */}
@@ -495,8 +495,8 @@ public class IRCChannelInfo implements ChannelInfo {
495 495
         
496 496
         // Hyperion sucks.
497 497
         if (cMode == 'b' || cMode == 'q') {
498
-            final String thisIRCD = myParser.getIRCD(true).toLowerCase();
499
-            if ((thisIRCD.equals("hyperion") || thisIRCD.equals("dancer"))) {
498
+            final ServerType serverType = myParser.getServerType();
499
+            if ((serverType == ServerType.DANCER || serverType == ServerType.HYPERION)) {
500 500
                 if (cMode == 'b' && givenItem.getItem().charAt(0) == '%') {
501 501
                     cMode = 'q';
502 502
                 } else if (cMode == 'q' && givenItem.getItem().charAt(0) != '%') {

+ 20
- 11
src/com/dmdirc/parser/irc/ProcessListModes.java Bestand weergeven

@@ -44,7 +44,7 @@ public class ProcessListModes extends IRCProcessor {
44 44
     @Override
45 45
     public void process(String sParam, String[] token) {
46 46
         IRCChannelInfo channel = getChannel(token[3]);
47
-        String thisIRCD = myParser.getIRCD(true).toLowerCase();
47
+        final ServerType serverType = myParser.getServerType();
48 48
         String item = "";
49 49
         String owner = "";
50 50
         byte tokenStart = 4; // Where do the relevent tokens start?
@@ -56,7 +56,8 @@ public class ProcessListModes extends IRCProcessor {
56 56
         
57 57
         if (sParam.equals("367") || sParam.equals("368")) {
58 58
             // Ban List/Item.
59
-            // (Also used for +d and +q on hyperion... -_-)
59
+            // (Also used for +d and +q on dancer/hyperion... -_-)
60
+            // (Also used for +q on ircd-seven... -_-)
60 61
             mode = 'b';
61 62
             isItem = sParam.equals("367");
62 63
         } else if (sParam.equals("348") || sParam.equals("349")) {
@@ -73,19 +74,19 @@ public class ProcessListModes extends IRCProcessor {
73 74
             isItem = sParam.equals("941");
74 75
         } else if (sParam.equals("344") || sParam.equals("345")) {
75 76
             // Reop List, or bad words list, or quiet list. god damn.
76
-            if (thisIRCD.equals("euircd")) {
77
+            if (serverType == ServerType.EUIRCD) {
77 78
                 mode = 'w';
78
-            } else if (thisIRCD.equals("oftc-hybrid")) {
79
+            } else if (serverType == ServerType.OFTC_HYBRID) {
79 80
                 mode = 'q';
80 81
             } else {
81 82
                 mode = 'R';
82 83
             }
83 84
             isItem = sParam.equals("344");
84
-        } else if (thisIRCD.equals("swiftirc") && (sParam.equals("386") || sParam.equals("387"))) {
85
+        } else if ((serverType == ServerType.SWIFTIRC || serverType == ServerType.AUSTHEX8) && (sParam.equals("386") || sParam.equals("387"))) {
85 86
             // Channel Owner list
86 87
             mode = 'q';
87 88
             isItem = sParam.equals("387");
88
-        } else if (thisIRCD.equals("swiftirc") && (sParam.equals("388") || sParam.equals("389"))) {
89
+        } else if ((serverType == ServerType.SWIFTIRC || serverType == ServerType.AUSTHEX8) && (sParam.equals("388") || sParam.equals("389"))) {
89 90
             // Protected User list
90 91
             mode = 'a';
91 92
             isItem = sParam.equals("389");
@@ -117,7 +118,7 @@ public class ProcessListModes extends IRCProcessor {
117 118
                     //
118 119
                     // Only raise an LMQ error if the lmqmode isn't one of bdq if the
119 120
                     // guess is one of bdq
120
-                    if ((thisIRCD.equals("hyperion") || thisIRCD.equals("dancer")) && (mode == 'b' || mode == 'q' || mode == 'd')) {
121
+                    if ((serverType == ServerType.DANCER || serverType == ServerType.HYPERION) && (mode == 'b' || mode == 'q' || mode == 'd')) {
121 122
                         LinkedList<Character> lmq = (LinkedList<Character>)listModeQueue;
122 123
                         if (mode == 'b') {
123 124
                             error = !(oldMode == 'q' || oldMode == 'd');
@@ -130,8 +131,16 @@ public class ProcessListModes extends IRCProcessor {
130 131
                         } else if (mode == 'd') {
131 132
                             error = !(oldMode == 'b' || oldMode == 'q');
132 133
                         }
134
+                    } else if ((serverType == ServerType.IRCD_SEVEN || serverType == ServerType.CHARYBDIS) && (mode == 'b' || mode == 'q')) {
135
+                        // Finally freenode appear to have an ircd which isn't completely annoying.
136
+                        // Only error if the LMQ thinks the mode should be
137
+                        // something thats not the other one of these 2 modes.
138
+                        error = (mode == 'b') ? oldMode != 'q' : oldMode != 'b';
133 139
                     }
134
-                    
140
+
141
+                    // If the lmq and the actual mode are not the same or the
142
+                    // freenode-specific hacks above think the mode should be
143
+                    // something else, error.
135 144
                     if (oldMode != mode && error) {
136 145
                         myParser.callDebugInfo(IRCParser.DEBUG_LMQ, "LMQ disagrees with guess. LMQ: "+mode+" Guess: "+oldMode);
137 146
 //                        myParser.callErrorInfo(new ParserError(ParserError.ERROR_WARNING, "LMQ disagrees with guess. LMQ: "+mode+" Guess: "+oldMode, myParser.getLastLine()));
@@ -145,7 +154,7 @@ public class ProcessListModes extends IRCProcessor {
145 154
         }
146 155
         
147 156
         if (isItem) {
148
-            if ((!isCleverMode) && listModeQueue == null && (thisIRCD.equals("hyperion") || thisIRCD.equals("dancer")) && token.length > 4 && mode == 'b') {
157
+            if ((!isCleverMode) && listModeQueue == null && (serverType == ServerType.DANCER || serverType == ServerType.HYPERION) && token.length > 4 && mode == 'b') {
149 158
                 // Assume mode is a 'd' mode
150 159
                 mode = 'd';
151 160
                 // Now work out if its not (or attempt to.)
@@ -153,7 +162,7 @@ public class ProcessListModes extends IRCProcessor {
153 162
                 int hoststart = token[tokenStart].indexOf('@');
154 163
                 // Check that ! and @ are both in the string - as required by +b and +q
155 164
                 if ((identstart >= 0) && (identstart < hoststart)) {
156
-                    if (thisIRCD.equals("hyperion") && token[tokenStart].charAt(0) == '%') { mode = 'q'; }
165
+                    if (serverType == ServerType.HYPERION && token[tokenStart].charAt(0) == '%') { mode = 'q'; }
157 166
                     else { mode = 'b'; }
158 167
                 }
159 168
             } // End Hyperian stupidness of using the same numeric for 3 different things..
@@ -165,7 +174,7 @@ public class ProcessListModes extends IRCProcessor {
165 174
                     myParser.callErrorInfo(new ParserError(ParserError.ERROR_WARNING, "Got list mode: '"+mode+"' - but channel object doesn't agree.", myParser.getLastLine()));
166 175
                 } else {
167 176
                     list.clear();
168
-                    if ((thisIRCD.equals("hyperion") || thisIRCD.equals("dancer")) && (mode == 'b' || mode == 'q')) {
177
+                    if ((serverType == ServerType.DANCER || serverType == ServerType.HYPERION) && (mode == 'b' || mode == 'q')) {
169 178
                         // Also clear the other list if b or q.
170 179
                         final Character otherMode = (mode == 'b') ? 'q' : 'b';
171 180
                         

+ 11
- 3
src/com/dmdirc/parser/irc/ServerType.java Bestand weergeven

@@ -1,5 +1,5 @@
1 1
 /*
2
- *  Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ *  Copyright (c) 2006-2010 Chris Smith, Shane Mc Cormack, Gregory Holmes
3 3
  * 
4 4
  *  Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  *  of this software and associated documentation files (the "Software"), to deal
@@ -53,16 +53,20 @@ public enum ServerType {
53 53
     IRCU2("ircu", ".*u2\\.[0-9]+\\..*"),
54 54
     /** Some kind of IRCU Fork. */
55 55
     IRCU_GENERIC("ircu", ".*ircu.*"),
56
+    /** Rizon. */
57
+    IRCD_RIZON("ircd-rixon", ".*ircd-rizon.*", "eI"),
56 58
     /** Plexus. */
57
-    PLEXUS("plexus", ".*plexus.*"),
59
+    PLEXUS("plexus", ".*plexus.*", "eI"),
58 60
     /** OFTCs hybrid fork. */
59 61
     OFTC_HYBRID("oftc-hybrid", ".*hybrid.*oftc.*"),
60 62
     /** hybrid7. */
61 63
     HYBRID7("hybrid7", ".*ircd.hybrid.*", "eI"),
62 64
     /** Older versions of Hybrid. */
63 65
     HYBRID("hybrid", ".*hybrid.*", "eI"),
64
-    /** Freenodes new IRCD. */
66
+    /** Charybdis */
65 67
     CHARYBDIS("charybdis", ".*charybdis.*", "eI"),
68
+    /** Freenodes New IRCD. */
69
+    IRCD_SEVEN("ircd-seven", ".*ircd-seven.*", "eI"),
66 70
     /** Freenodes Current IRCD. */
67 71
     HYPERION("hyperion", ".*hyperion.*", "eI"),
68 72
     /** Freenodes Old IRCD. */
@@ -77,10 +81,14 @@ public enum ServerType {
77 81
     FQIRCD("fqircd", ".*fqircd.*"),
78 82
     /** Microsoft's Conference Room "IRCD". */
79 83
     CONFERENCEROOM("conferenceroom", ".*conferenceroom.*"),
84
+    /** AustHex8. */
85
+    AUSTHEX8("austhex8", "running version 8.1.6$", "eI", MatchType.RAW002),
80 86
     /** AustHex custom IRCD. */
81 87
     AUSTHEX("austhex", ".*austhex.*"),
82 88
     /** AustIRC custom IRCD. */
83 89
     AUSTIRC("austirc", ".*austirc.*"),
90
+    /** IRSEE custom IRCD. */
91
+    IRSEE("irsee", ".*irsee.*"),
84 92
     /** Ratbox. */
85 93
     RATBOX("ratbox", ".*ratbox.*"),
86 94
     /** euircd. */

Laden…
Annuleren
Opslaan