|
@@ -110,33 +110,42 @@ public class ProcessMessage extends IRCProcessor {
|
110
|
110
|
boolean isCTCP = false;
|
111
|
111
|
|
112
|
112
|
if (sMessage.length() > 1) {
|
113
|
|
- if (sParam.equalsIgnoreCase("PRIVMSG")) {
|
114
|
|
- // Actions are special CTCPs
|
115
|
|
- // Bits is the message been split into 2 parts, the first word and the rest
|
116
|
|
- if (bits[0].equalsIgnoreCase(char1+"ACTION") && Character.valueOf(sMessage.charAt(sMessage.length()-1)).equals(char1)) {
|
117
|
|
- isAction = true;
|
118
|
|
- if (bits.length > 1) {
|
119
|
|
- sMessage = bits[1];
|
120
|
|
- sMessage = sMessage.substring(0, sMessage.length()-1);
|
121
|
|
- } else { sMessage = ""; }
|
122
|
|
- }
|
|
113
|
+ // Actions are special CTCPs
|
|
114
|
+ // Bits is the message been split into 2 parts
|
|
115
|
+ // the first word and the rest
|
|
116
|
+ if (sParam.equalsIgnoreCase("PRIVMSG") && bits[0].equalsIgnoreCase(
|
|
117
|
+ char1+"ACTION") && Character.valueOf(sMessage.charAt(
|
|
118
|
+ sMessage.length()-1)).equals(char1)) {
|
|
119
|
+ isAction = true;
|
|
120
|
+ if (bits.length > 1) {
|
|
121
|
+ sMessage = bits[1];
|
|
122
|
+ sMessage = sMessage.substring(0, sMessage.length()-1);
|
|
123
|
+ } else { sMessage = ""; }
|
123
|
124
|
}
|
124
|
125
|
// If the message is not an action, check if it is another type of CTCP
|
125
|
|
- if (!isAction) {
|
126
|
|
- // CTCPs have Character(1) at the start/end of the line
|
127
|
|
- if (Character.valueOf(sMessage.charAt(0)).equals(char1) && Character.valueOf(sMessage.charAt(sMessage.length()-1)).equals(char1)) {
|
128
|
|
- isCTCP = true;
|
129
|
|
- // Bits is the message been split into 2 parts, the first word and the rest
|
130
|
|
- // Some CTCPs have messages and some do not
|
131
|
|
- if (bits.length > 1) { sMessage = bits[1]; } else { sMessage = ""; }
|
132
|
|
- // Remove the leading char1
|
133
|
|
- bits = bits[0].split(char1.toString(), 2);
|
134
|
|
- sCTCP = bits[1];
|
135
|
|
- // remove the trailing char1
|
136
|
|
- if (!sMessage.isEmpty()) { sMessage = sMessage.split(char1.toString(), 2)[0]; }
|
137
|
|
- else { sCTCP = sCTCP.split(char1.toString(), 2)[0]; }
|
138
|
|
- callDebugInfo(IRCParser.DEBUG_INFO, "CTCP: \"%s\" \"%s\"", sCTCP, sMessage);
|
|
126
|
+ // CTCPs have Character(1) at the start/end of the line
|
|
127
|
+ if (!isAction && Character.valueOf(sMessage.charAt(0)).equals(char1)
|
|
128
|
+ && Character.valueOf(sMessage.charAt(sMessage.length()-1))
|
|
129
|
+ .equals(char1)) {
|
|
130
|
+ isCTCP = true;
|
|
131
|
+ // Bits is the message been split into 2 parts, the first word and the rest
|
|
132
|
+ // Some CTCPs have messages and some do not
|
|
133
|
+ if (bits.length > 1) {
|
|
134
|
+ sMessage = bits[1];
|
|
135
|
+ } else {
|
|
136
|
+ sMessage = "";
|
|
137
|
+ }
|
|
138
|
+ // Remove the leading char1
|
|
139
|
+ bits = bits[0].split(char1.toString(), 2);
|
|
140
|
+ sCTCP = bits[1];
|
|
141
|
+ // remove the trailing char1
|
|
142
|
+ if (!sMessage.isEmpty()) {
|
|
143
|
+ sMessage = sMessage.split(char1.toString(), 2)[0];
|
|
144
|
+ } else {
|
|
145
|
+ sCTCP = sCTCP.split(char1.toString(), 2)[0];
|
139
|
146
|
}
|
|
147
|
+ callDebugInfo(IRCParser.DEBUG_INFO, "CTCP: \"%s\" \"%s\"",
|
|
148
|
+ sCTCP, sMessage);
|
140
|
149
|
}
|
141
|
150
|
}
|
142
|
151
|
|
|
@@ -144,9 +153,10 @@ public class ProcessMessage extends IRCProcessor {
|
144
|
153
|
if (token[0].charAt(0) == ':' && token[0].length() > 1) { token[0] = token[0].substring(1); }
|
145
|
154
|
|
146
|
155
|
iClient = getClientInfo(token[0]);
|
147
|
|
- if (IRCParser.ALWAYS_UPDATECLIENT && iClient != null) {
|
148
|
|
- // Facilitate DMDIRC Formatter
|
149
|
|
- if (iClient.getHostname().isEmpty()) {iClient.setUserBits(token[0], false); }
|
|
156
|
+ // Facilitate DMDIRC Formatter
|
|
157
|
+ if ((IRCParser.ALWAYS_UPDATECLIENT && iClient != null) && iClient
|
|
158
|
+ .getHostname().isEmpty()) {
|
|
159
|
+ iClient.setUserBits(token[0], false);
|
150
|
160
|
}
|
151
|
161
|
|
152
|
162
|
// Fire the appropriate callbacks.
|