|
@@ -120,7 +120,7 @@ public class ProcessMode extends IRCProcessor {
|
120
|
120
|
CallbackObject cbSingle = null;
|
121
|
121
|
CallbackObject cbNonUser = null;
|
122
|
122
|
|
123
|
|
- if (!sParam.equals("324")) {
|
|
123
|
+ if (!"324".equals(sParam)) {
|
124
|
124
|
cbSingle = getCallbackManager().getCallbackType(ChannelSingleModeChangeListener.class);
|
125
|
125
|
cbNonUser = getCallbackManager().getCallbackType(ChannelNonUserModeChangeListener.class);
|
126
|
126
|
}
|
|
@@ -130,13 +130,13 @@ public class ProcessMode extends IRCProcessor {
|
130
|
130
|
return;
|
131
|
131
|
}
|
132
|
132
|
// Get the current channel modes
|
133
|
|
- if (!sParam.equals("324")) {
|
|
133
|
+ if (!"324".equals(sParam)) {
|
134
|
134
|
nCurrent = iChannel.getMode();
|
135
|
135
|
}
|
136
|
136
|
|
137
|
137
|
setterCCI = iChannel.getChannelClient(token[0]);
|
138
|
138
|
// Facilitate dmdirc formatter
|
139
|
|
- if ((IRCParser.ALWAYS_UPDATECLIENT && setterCCI != null) && setterCCI.getClient().getHostname().isEmpty()) {
|
|
139
|
+ if (IRCParser.ALWAYS_UPDATECLIENT && setterCCI != null && setterCCI.getClient().getHostname().isEmpty()) {
|
140
|
140
|
setterCCI.getClient().setUserBits(token[0], false);
|
141
|
141
|
}
|
142
|
142
|
|
|
@@ -147,7 +147,7 @@ public class ProcessMode extends IRCProcessor {
|
147
|
147
|
continue;
|
148
|
148
|
}
|
149
|
149
|
|
150
|
|
- sNonUserModeStr = sNonUserModeStr + cMode;
|
|
150
|
+ sNonUserModeStr += cMode;
|
151
|
151
|
if (cMode.equals("+".charAt(0))) {
|
152
|
152
|
cPositive = '+';
|
153
|
153
|
bPositive = true;
|
|
@@ -173,7 +173,8 @@ public class ProcessMode extends IRCProcessor {
|
173
|
173
|
iChannelClientInfo = iChannel.getChannelClient(sModeParam);
|
174
|
174
|
if (iChannelClientInfo == null) {
|
175
|
175
|
// Client not known?
|
176
|
|
- callDebugInfo(IRCParser.DEBUG_INFO, "User Mode for client not on channel. Ignoring (%s)", iChannelClientInfo);
|
|
176
|
+ callDebugInfo(IRCParser.DEBUG_INFO, "User Mode for client not on channel." +
|
|
177
|
+ " Ignoring (%s)", sModeParam);
|
177
|
178
|
continue;
|
178
|
179
|
}
|
179
|
180
|
callDebugInfo(IRCParser.DEBUG_INFO, "\tOld Mode Value: %d", iChannelClientInfo.getChanMode());
|
|
@@ -181,10 +182,11 @@ public class ProcessMode extends IRCProcessor {
|
181
|
182
|
iChannelClientInfo.setChanMode(iChannelClientInfo.getChanMode() | nValue);
|
182
|
183
|
sTemp = "+";
|
183
|
184
|
} else {
|
184
|
|
- iChannelClientInfo.setChanMode(iChannelClientInfo.getChanMode() ^ (iChannelClientInfo.getChanMode() & nValue));
|
|
185
|
+ iChannelClientInfo.setChanMode(iChannelClientInfo.getChanMode() ^
|
|
186
|
+ iChannelClientInfo.getChanMode() & nValue);
|
185
|
187
|
sTemp = "-";
|
186
|
188
|
}
|
187
|
|
- sTemp = sTemp + cMode;
|
|
189
|
+ sTemp += cMode;
|
188
|
190
|
callChannelUserModeChanged(iChannel, iChannelClientInfo, setterCCI, token[0], sTemp);
|
189
|
191
|
continue;
|
190
|
192
|
} else {
|
|
@@ -192,20 +194,22 @@ public class ProcessMode extends IRCProcessor {
|
192
|
194
|
parser.chanModesBool.put(cMode, parser.nextKeyCMBool);
|
193
|
195
|
nValue = parser.nextKeyCMBool;
|
194
|
196
|
bBooleanMode = true;
|
195
|
|
- parser.nextKeyCMBool = parser.nextKeyCMBool * 2;
|
|
197
|
+ parser.nextKeyCMBool *= 2;
|
196
|
198
|
}
|
197
|
199
|
|
198
|
200
|
if (bBooleanMode) {
|
199
|
201
|
callDebugInfo(IRCParser.DEBUG_INFO, "Boolean Mode: %c [%d] {Positive: %b}", cMode, nValue, bPositive);
|
200
|
202
|
|
201
|
203
|
if (bPositive) {
|
202
|
|
- nCurrent = nCurrent | nValue;
|
|
204
|
+ nCurrent |= nValue;
|
203
|
205
|
} else {
|
204
|
|
- nCurrent = nCurrent ^ (nCurrent & nValue);
|
|
206
|
+ nCurrent ^= nCurrent & nValue;
|
205
|
207
|
}
|
206
|
208
|
} else {
|
207
|
209
|
|
208
|
|
- if ((bPositive || nValue == IRCParser.MODE_LIST || ((nValue & IRCParser.MODE_UNSET) == IRCParser.MODE_UNSET)) && (sModestr.length <= nParam)) {
|
|
210
|
+ if ((bPositive || nValue == IRCParser.MODE_LIST ||
|
|
211
|
+ (nValue & IRCParser.MODE_UNSET) == IRCParser.MODE_UNSET) &&
|
|
212
|
+ sModestr.length <= nParam) {
|
209
|
213
|
parser.callErrorInfo(new ParserError(ParserError.ERROR_FATAL + ParserError.ERROR_USER, "Broken Modes. Parameter required but not given.", parser.getLastLine()));
|
210
|
214
|
continue;
|
211
|
215
|
}
|
|
@@ -213,7 +217,7 @@ public class ProcessMode extends IRCProcessor {
|
213
|
217
|
if (nValue == IRCParser.MODE_LIST) {
|
214
|
218
|
// List Mode
|
215
|
219
|
sModeParam = sModestr[nParam++];
|
216
|
|
- sNonUserModeStrParams = sNonUserModeStrParams + " " + sModeParam;
|
|
220
|
+ sNonUserModeStrParams = sNonUserModeStrParams + ' ' + sModeParam;
|
217
|
221
|
nTemp = Calendar.getInstance().getTimeInMillis() / 1000;
|
218
|
222
|
iChannel.setListModeParam(cMode, new ChannelListModeItem(sModeParam, token[0], nTemp), bPositive);
|
219
|
223
|
callDebugInfo(IRCParser.DEBUG_INFO, "List Mode: %c [%s] {Positive: %b}", cMode, sModeParam, bPositive);
|
|
@@ -225,7 +229,7 @@ public class ProcessMode extends IRCProcessor {
|
225
|
229
|
if (bPositive) {
|
226
|
230
|
// +Mode - always needs a parameter to set
|
227
|
231
|
sModeParam = sModestr[nParam++];
|
228
|
|
- sNonUserModeStrParams = sNonUserModeStrParams + " " + sModeParam;
|
|
232
|
+ sNonUserModeStrParams = sNonUserModeStrParams + ' ' + sModeParam;
|
229
|
233
|
callDebugInfo(IRCParser.DEBUG_INFO, "Set Mode: %c [%s] {Positive: %b}", cMode, sModeParam, bPositive);
|
230
|
234
|
iChannel.setModeParam(cMode, sModeParam);
|
231
|
235
|
if (cbSingle != null) {
|
|
@@ -235,7 +239,7 @@ public class ProcessMode extends IRCProcessor {
|
235
|
239
|
// -Mode - parameter isn't always needed, we need to check
|
236
|
240
|
if ((nValue & IRCParser.MODE_UNSET) == IRCParser.MODE_UNSET) {
|
237
|
241
|
sModeParam = sModestr[nParam++];
|
238
|
|
- sNonUserModeStrParams = sNonUserModeStrParams + " " + sModeParam;
|
|
242
|
+ sNonUserModeStrParams = sNonUserModeStrParams + ' ' + sModeParam;
|
239
|
243
|
} else {
|
240
|
244
|
sModeParam = "";
|
241
|
245
|
}
|
|
@@ -256,7 +260,7 @@ public class ProcessMode extends IRCProcessor {
|
256
|
260
|
}
|
257
|
261
|
|
258
|
262
|
iChannel.setMode(nCurrent);
|
259
|
|
- if (sParam.equals("324")) {
|
|
263
|
+ if ("324".equals(sParam)) {
|
260
|
264
|
callChannelModeChanged(iChannel, null, "", sFullModeStr.toString().trim());
|
261
|
265
|
} else {
|
262
|
266
|
callChannelModeChanged(iChannel, setterCCI, token[0], sFullModeStr.toString().trim());
|