|
@@ -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
|
|