summaryrefslogtreecommitdiff
authorwazlaf <wazlaf>2002-09-29 19:54:12 (UTC)
committer wazlaf <wazlaf>2002-09-29 19:54:12 (UTC)
commit1dd254c95a582c2c86c816516a1b4433d8142d8a (patch) (unidiff)
treea3225293a4b399494a04e5bb07154bd673ba0acf
parentf91ea4e068f38e9df17b06c87cd8635628837a4f (diff)
downloadopie-1dd254c95a582c2c86c816516a1b4433d8142d8a.zip
opie-1dd254c95a582c2c86c816516a1b4433d8142d8a.tar.gz
opie-1dd254c95a582c2c86c816516a1b4433d8142d8a.tar.bz2
some more message types supported to make this work more smoothly with freenode.net
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieirc/ircmessageparser.cpp33
-rw-r--r--noncore/net/opieirc/ircmessageparser.h3
-rw-r--r--noncore/net/opieirc/ircoutput.h3
-rw-r--r--noncore/net/opieirc/ircservertab.cpp12
4 files changed, 49 insertions, 2 deletions
diff --git a/noncore/net/opieirc/ircmessageparser.cpp b/noncore/net/opieirc/ircmessageparser.cpp
index 5c70753..d1b70a5 100644
--- a/noncore/net/opieirc/ircmessageparser.cpp
+++ b/noncore/net/opieirc/ircmessageparser.cpp
@@ -1,86 +1,89 @@
1#include <qtextstream.h> 1#include <qtextstream.h>
2#include "ircmessageparser.h" 2#include "ircmessageparser.h"
3#include "ircversion.h" 3#include "ircversion.h"
4 4
5/* Lookup table for literal commands */ 5/* Lookup table for literal commands */
6IRCLiteralMessageParserStruct IRCMessageParser::literalParserProcTable[] = { 6IRCLiteralMessageParserStruct IRCMessageParser::literalParserProcTable[] = {
7 { "PING", FUNC(parseLiteralPing) }, 7 { "PING", FUNC(parseLiteralPing) },
8 { "NOTICE", FUNC(parseLiteralNotice) }, 8 { "NOTICE", FUNC(parseLiteralNotice) },
9 { "JOIN", FUNC(parseLiteralJoin) }, 9 { "JOIN", FUNC(parseLiteralJoin) },
10 { "PRIVMSG", FUNC(parseLiteralPrivMsg) }, 10 { "PRIVMSG", FUNC(parseLiteralPrivMsg) },
11 { "NICK", FUNC(parseLiteralNick) }, 11 { "NICK", FUNC(parseLiteralNick) },
12 { "PART", FUNC(parseLiteralPart) }, 12 { "PART", FUNC(parseLiteralPart) },
13 { "QUIT", FUNC(parseLiteralQuit) }, 13 { "QUIT", FUNC(parseLiteralQuit) },
14 { "ERROR", FUNC(parseLiteralError) }, 14 { "ERROR", FUNC(parseLiteralError) },
15 { "ERROR:", FUNC(parseLiteralError) }, 15 { "ERROR:", FUNC(parseLiteralError) },
16 { "MODE", FUNC(parseLiteralMode) }, 16 { "MODE", FUNC(parseLiteralMode) },
17 { "KICK", FUNC(parseLiteralKick) }, 17 { "KICK", FUNC(parseLiteralKick) },
18 { "TOPIC", FUNC(parseLiteralTopic) },
18 { 0 , 0 } 19 { 0 , 0 }
19}; 20};
20 21
21/* Lookup table for literal commands */ 22/* Lookup table for literal commands */
22IRCCTCPMessageParserStruct IRCMessageParser::ctcpParserProcTable[] = { 23IRCCTCPMessageParserStruct IRCMessageParser::ctcpParserProcTable[] = {
23 { "PING", FUNC(parseCTCPPing) }, 24 { "PING", FUNC(parseCTCPPing) },
24 { "VERSION", FUNC(parseCTCPVersion) }, 25 { "VERSION", FUNC(parseCTCPVersion) },
25 { "ACTION", FUNC(parseCTCPAction) }, 26 { "ACTION", FUNC(parseCTCPAction) },
26 { 0 , 0 } 27 { 0 , 0 }
27}; 28};
28 29
29/* Lookup table for numerical commands */ 30/* Lookup table for numerical commands */
30IRCNumericalMessageParserStruct IRCMessageParser::numericalParserProcTable[] = { 31IRCNumericalMessageParserStruct IRCMessageParser::numericalParserProcTable[] = {
31 { 1, FUNC(parseNumerical001) }, // RPL_WELCOME 32 { 1, FUNC(parseNumerical001) }, // RPL_WELCOME
32 { 2, FUNC(parseNumerical002) }, // RPL_YOURHOST 33 { 2, FUNC(parseNumerical002) }, // RPL_YOURHOST
33 { 3, FUNC(parseNumerical003) }, // RPL_CREATED 34 { 3, FUNC(parseNumerical003) }, // RPL_CREATED
34 { 4, FUNC(parseNumerical004) }, // RPL_MYINFO 35 { 4, FUNC(parseNumerical004) }, // RPL_MYINFO
35 { 5, FUNC(parseNumerical005) }, // RPL_BOUNCE, RPL_PROTOCTL 36 { 5, FUNC(parseNumerical005) }, // RPL_BOUNCE, RPL_PROTOCTL
36 { 251, FUNC(parseNumericalStats) }, // RPL_LUSERCLIENT 37 { 251, FUNC(parseNumericalStats) }, // RPL_LUSERCLIENT
37 { 254, FUNC(nullFunc)}, // RPL_LUSERCHANNELS 38 { 254, FUNC(nullFunc)}, // RPL_LUSERCHANNELS
38 { 255, FUNC(parseNumericalStats) }, // RPL_LUSERNAME 39 { 255, FUNC(parseNumericalStats) }, // RPL_LUSERNAME
40 { 332, FUNC(parseNumericalTopic) }, // RPL_TOPIC
41 { 333, FUNC(parseNumericalTopicWhoTime) }, // RPL_TOPICWHOTIME
39 { 353, FUNC(parseNumericalNames) }, // RPL_NAMREPLY 42 { 353, FUNC(parseNumericalNames) }, // RPL_NAMREPLY
40 { 366, FUNC(parseNumericalEndOfNames) }, // RPL_ENDOFNAMES 43 { 366, FUNC(parseNumericalEndOfNames) }, // RPL_ENDOFNAMES
41 { 375, FUNC(parseNumericalStats) }, // RPL_MOTDSTART 44 { 375, FUNC(parseNumericalStats) }, // RPL_MOTDSTART
42 { 372, FUNC(parseNumericalStats) }, // RPL_MOTD 45 { 372, FUNC(parseNumericalStats) }, // RPL_MOTD
43 { 376, FUNC(parseNumericalStats) }, // RPL_ENDOFMOTD 46 { 376, FUNC(parseNumericalStats) }, // RPL_ENDOFMOTD
44 { 377, FUNC(parseNumericalStats) }, // RPL_MOTD2 47 { 377, FUNC(parseNumericalStats) }, // RPL_MOTD2
45 { 378, FUNC(parseNumericalStats) }, // RPL_MOTD3 48 { 378, FUNC(parseNumericalStats) }, // RPL_MOTD3
46 { 401, FUNC(parseNumericalNoSuchNick) }, // ERR_NOSUCHNICK 49 { 401, FUNC(parseNumericalNoSuchNick) }, // ERR_NOSUCHNICK
47 { 406, FUNC(parseNumericalNoSuchNick) }, // ERR_WASNOSUCHNICK 50 { 406, FUNC(parseNumericalNoSuchNick) }, // ERR_WASNOSUCHNICK
48 { 412, FUNC(parseNumericalStats) }, // ERR_NOTEXTTOSEND 51 { 412, FUNC(parseNumericalStats) }, // ERR_NOTEXTTOSEND
49 { 433, FUNC(parseNumericalNicknameInUse) }, // ERR_NICKNAMEINUSE 52 { 433, FUNC(parseNumericalNicknameInUse) }, // ERR_NICKNAMEINUSE
50 { 0, 0 } 53 { 0, 0 }
51}; 54};
52 55
53IRCMessageParser::IRCMessageParser(IRCSession *session) { 56IRCMessageParser::IRCMessageParser(IRCSession *session) {
54 m_session = session; 57 m_session = session;
55} 58}
56 59
57void IRCMessageParser::parse(IRCMessage *message) { 60void IRCMessageParser::parse(IRCMessage *message) {
58 /* Find out what kind of message we have here and call the appropriate handler using 61 /* Find out what kind of message we have here and call the appropriate handler using
59 the parser tables. If no handler can be found, print out an error message */ 62 the parser tables. If no handler can be found, print out an error message */
60 if (message->isNumerical()) { 63 if (message->isNumerical()) {
61 for (int i=0; i<numericalParserProcTable[i].commandNumber; i++) { 64 for (int i=0; i<numericalParserProcTable[i].commandNumber; i++) {
62 if (message->commandNumber() == numericalParserProcTable[i].commandNumber) { 65 if (message->commandNumber() == numericalParserProcTable[i].commandNumber) {
63 (this->*(numericalParserProcTable[i].proc))(message); 66 (this->*(numericalParserProcTable[i].proc))(message);
64 return; 67 return;
65 } 68 }
66 } 69 }
67 emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Received unhandled numeric command : ")+QString::number(message->commandNumber()))); 70 emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Received unhandled numeric command : ")+QString::number(message->commandNumber())));
68 } else if (message->isCTCP()) { 71 } else if (message->isCTCP()) {
69 for (int i=0; ctcpParserProcTable[i].commandName; i++) { 72 for (int i=0; ctcpParserProcTable[i].commandName; i++) {
70 if (message->ctcpCommand() == ctcpParserProcTable[i].commandName) { 73 if (message->ctcpCommand() == ctcpParserProcTable[i].commandName) {
71 (this->*(ctcpParserProcTable[i].proc))(message); 74 (this->*(ctcpParserProcTable[i].proc))(message);
72 return; 75 return;
73 } 76 }
74 } 77 }
75 emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Received unhandled ctcp command : ")+message->ctcpCommand())); 78 emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Received unhandled ctcp command : ")+message->ctcpCommand()));
76 } else { 79 } else {
77 for (int i=0; literalParserProcTable[i].commandName; i++) { 80 for (int i=0; literalParserProcTable[i].commandName; i++) {
78 if (message->command() == literalParserProcTable[i].commandName) { 81 if (message->command() == literalParserProcTable[i].commandName) {
79 (this->*(literalParserProcTable[i].proc))(message); 82 (this->*(literalParserProcTable[i].proc))(message);
80 return; 83 return;
81 } 84 }
82 } 85 }
83 emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Received unhandled literal command : ")+message->command())); 86 emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Received unhandled literal command : ")+message->command()));
84 } 87 }
85} 88}
86 89
@@ -146,147 +149,159 @@ void IRCMessageParser::parseLiteralPart(IRCMessage *message) {
146 emit outputReady(output); 149 emit outputReady(output);
147 delete channel; 150 delete channel;
148 } else { 151 } else {
149 IRCChannelPerson *person = channel->getPerson(mask.nick()); 152 IRCChannelPerson *person = channel->getPerson(mask.nick());
150 if (person) { 153 if (person) {
151 channel->removePerson(person); 154 channel->removePerson(person);
152 IRCOutput output(OUTPUT_OTHERPART, mask.nick() + tr(" left channel ") + channelName); 155 IRCOutput output(OUTPUT_OTHERPART, mask.nick() + tr(" left channel ") + channelName);
153 output.addParam(channel); 156 output.addParam(channel);
154 output.addParam(person); 157 output.addParam(person);
155 emit outputReady(output); 158 emit outputReady(output);
156 delete person; 159 delete person;
157 } else { 160 } else {
158 emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Parting person not found - desynchronized?"))); 161 emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Parting person not found - desynchronized?")));
159 } 162 }
160 } 163 }
161 } else { 164 } else {
162 emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Channel for part not found - desynchronized?"))); 165 emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Channel for part not found - desynchronized?")));
163 } 166 }
164} 167}
165 168
166void IRCMessageParser::parseLiteralPrivMsg(IRCMessage *message) { 169void IRCMessageParser::parseLiteralPrivMsg(IRCMessage *message) {
167 if (m_session->m_server->nick() == message->param(0)) { 170 if (m_session->m_server->nick() == message->param(0)) {
168 /* IRC Query message detected, verify sender and display it */ 171 /* IRC Query message detected, verify sender and display it */
169 IRCPerson mask(message->prefix()); 172 IRCPerson mask(message->prefix());
170 IRCPerson *person = m_session->getPerson(mask.nick()); 173 IRCPerson *person = m_session->getPerson(mask.nick());
171 if (!person) { 174 if (!person) {
172 /* Person not yet known, create and add to the current session */ 175 /* Person not yet known, create and add to the current session */
173 person = new IRCPerson(message->prefix()); 176 person = new IRCPerson(message->prefix());
174 m_session->addPerson(person); 177 m_session->addPerson(person);
175 } 178 }
176 IRCOutput output(OUTPUT_QUERYPRIVMSG, message->param(1)); 179 IRCOutput output(OUTPUT_QUERYPRIVMSG, message->param(1));
177 output.addParam(person); 180 output.addParam(person);
178 emit outputReady(output); 181 emit outputReady(output);
179 } else if (message->param(0).at(0) == '#') { 182 } else if (message->param(0).at(0) == '#') {
180 /* IRC Channel message detected, verify sender, channel and display it */ 183 /* IRC Channel message detected, verify sender, channel and display it */
181 IRCChannel *channel = m_session->getChannel(message->param(0)); 184 IRCChannel *channel = m_session->getChannel(message->param(0));
182 if (channel) { 185 if (channel) {
183 IRCPerson mask(message->prefix()); 186 IRCPerson mask(message->prefix());
184 IRCChannelPerson *person = channel->getPerson(mask.nick()); 187 IRCChannelPerson *person = channel->getPerson(mask.nick());
185 if (person) { 188 if (person) {
186 IRCOutput output(OUTPUT_CHANPRIVMSG, message->param(1)); 189 IRCOutput output(OUTPUT_CHANPRIVMSG, message->param(1));
187 output.addParam(channel); 190 output.addParam(channel);
188 output.addParam(person); 191 output.addParam(person);
189 emit outputReady(output); 192 emit outputReady(output);
190 } else { 193 } else {
191 emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Channel message with unknown sender"))); 194 emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Channel message with unknown sender")));
192 } 195 }
193 } else { 196 } else {
194 emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Channel message with unknown channel"))); 197 emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Channel message with unknown channel ") + message->param(0)));
195 } 198 }
196 } else { 199 } else {
197 emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Received PRIVMSG of unknown type"))); 200 emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Received PRIVMSG of unknown type")));
198 } 201 }
199} 202}
200 203
201void IRCMessageParser::parseLiteralNick(IRCMessage *message) { 204void IRCMessageParser::parseLiteralNick(IRCMessage *message) {
202 IRCPerson mask(message->prefix()); 205 IRCPerson mask(message->prefix());
203 206
204 if (mask.nick() == m_session->m_server->nick()) { 207 if (mask.nick() == m_session->m_server->nick()) {
205 /* We are changing our nickname */ 208 /* We are changing our nickname */
206 m_session->m_server->setNick(message->param(0)); 209 m_session->m_server->setNick(message->param(0));
207 IRCOutput output(OUTPUT_NICKCHANGE, tr("You are now known as ")+message->param(0)); 210 IRCOutput output(OUTPUT_NICKCHANGE, tr("You are now known as ")+message->param(0));
208 output.addParam(0); 211 output.addParam(0);
209 emit outputReady(output); 212 emit outputReady(output);
210 } else { 213 } else {
211 /* Someone else is */ 214 /* Someone else is */
212 IRCPerson *person = m_session->getPerson(mask.nick()); 215 IRCPerson *person = m_session->getPerson(mask.nick());
213 if (person) { 216 if (person) {
214 IRCOutput output(OUTPUT_NICKCHANGE, mask.nick() + tr(" is now known as ") + message->param(0)); 217 IRCOutput output(OUTPUT_NICKCHANGE, mask.nick() + tr(" is now known as ") + message->param(0));
215 output.addParam(person); 218 output.addParam(person);
216 emit outputReady(output); 219 emit outputReady(output);
217 } else { 220 } else {
218 emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Nickname change of an unknown person"))); 221 emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Nickname change of an unknown person")));
219 } 222 }
220 } 223 }
221} 224}
222 225
223void IRCMessageParser::parseLiteralQuit(IRCMessage *message) { 226void IRCMessageParser::parseLiteralQuit(IRCMessage *message) {
224 IRCPerson mask(message->prefix()); 227 IRCPerson mask(message->prefix());
225 IRCPerson *person = m_session->getPerson(mask.nick()); 228 IRCPerson *person = m_session->getPerson(mask.nick());
226 if (person) { 229 if (person) {
227 QList<IRCChannel> channels; 230 QList<IRCChannel> channels;
228 m_session->getChannelsByPerson(person, channels); 231 m_session->getChannelsByPerson(person, channels);
229 QListIterator<IRCChannel> it(channels); 232 QListIterator<IRCChannel> it(channels);
230 for (;it.current(); ++it) { 233 for (;it.current(); ++it) {
231 IRCChannelPerson *chanperson = it.current()->getPerson(mask.nick()); 234 IRCChannelPerson *chanperson = it.current()->getPerson(mask.nick());
232 it.current()->removePerson(chanperson); 235 it.current()->removePerson(chanperson);
233 delete chanperson; 236 delete chanperson;
234 } 237 }
235 m_session->removePerson(person); 238 m_session->removePerson(person);
236 IRCOutput output(OUTPUT_QUIT, mask.nick() + tr(" has quit ") + "(" + message->param(0) + ")"); 239 IRCOutput output(OUTPUT_QUIT, mask.nick() + tr(" has quit ") + "(" + message->param(0) + ")");
237 output.addParam(person); 240 output.addParam(person);
238 emit outputReady(output); 241 emit outputReady(output);
239 delete person; 242 delete person;
240 } else { 243 } else {
241 emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Unknown person quit - desynchronized?"))); 244 emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Unknown person quit - desynchronized?")));
242 } 245 }
243} 246}
244 247
248void IRCMessageParser::parseLiteralTopic(IRCMessage *message) {
249 IRCPerson mask(message->prefix());
250 IRCChannel *channel = m_session->getChannel(message->param(0));
251 if (channel) {
252 IRCOutput output(OUTPUT_TOPIC, mask.nick() + tr(" changed topic to ") + "\"" + message->param(1) + "\"");
253 output.addParam(channel);
254 emit outputReady(output);
255 } else {
256 emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Unknown channel topic - desynchronized?")));
257 }
258}
259
245void IRCMessageParser::parseLiteralError(IRCMessage *message) { 260void IRCMessageParser::parseLiteralError(IRCMessage *message) {
246 emit outputReady(IRCOutput(OUTPUT_ERROR, message->allParameters())); 261 emit outputReady(IRCOutput(OUTPUT_ERROR, message->allParameters()));
247} 262}
248 263
249void IRCMessageParser::parseCTCPPing(IRCMessage *message) { 264void IRCMessageParser::parseCTCPPing(IRCMessage *message) {
250 IRCPerson mask(message->prefix()); 265 IRCPerson mask(message->prefix());
251 m_session->m_connection->sendCTCP(mask.nick(), "PING " + message->allParameters()); 266 m_session->m_connection->sendCTCP(mask.nick(), "PING " + message->allParameters());
252 emit outputReady(IRCOutput(OUTPUT_CTCP, tr("Received a CTCP PING from ")+mask.nick())); 267 emit outputReady(IRCOutput(OUTPUT_CTCP, tr("Received a CTCP PING from ")+mask.nick()));
253} 268}
254 269
255void IRCMessageParser::parseCTCPVersion(IRCMessage *message) { 270void IRCMessageParser::parseCTCPVersion(IRCMessage *message) {
256 IRCPerson mask(message->prefix()); 271 IRCPerson mask(message->prefix());
257 m_session->m_connection->sendCTCP(mask.nick(), APP_VERSION " " APP_COPYSTR); 272 m_session->m_connection->sendCTCP(mask.nick(), APP_VERSION " " APP_COPYSTR);
258 emit outputReady(IRCOutput(OUTPUT_CTCP, tr("Received a CTCP VERSION from ")+mask.nick())); 273 emit outputReady(IRCOutput(OUTPUT_CTCP, tr("Received a CTCP VERSION from ")+mask.nick()));
259} 274}
260 275
261void IRCMessageParser::parseCTCPAction(IRCMessage *message) { 276void IRCMessageParser::parseCTCPAction(IRCMessage *message) {
262 IRCPerson mask(message->prefix()); 277 IRCPerson mask(message->prefix());
263 QString dest = message->ctcpDestination(); 278 QString dest = message->ctcpDestination();
264 if (dest.startsWith("#")) { 279 if (dest.startsWith("#")) {
265 IRCChannel *channel = m_session->getChannel(dest); 280 IRCChannel *channel = m_session->getChannel(dest);
266 if (channel) { 281 if (channel) {
267 IRCChannelPerson *person = channel->getPerson(mask.nick()); 282 IRCChannelPerson *person = channel->getPerson(mask.nick());
268 if (person) { 283 if (person) {
269 IRCOutput output(OUTPUT_CHANACTION, "*" + mask.nick() + message->param(0)); 284 IRCOutput output(OUTPUT_CHANACTION, "*" + mask.nick() + message->param(0));
270 output.addParam(channel); 285 output.addParam(channel);
271 output.addParam(person); 286 output.addParam(person);
272 emit outputReady(output); 287 emit outputReady(output);
273 } else { 288 } else {
274 emit outputReady(IRCOutput(OUTPUT_ERROR, tr("CTCP ACTION with unknown person - Desynchronized?"))); 289 emit outputReady(IRCOutput(OUTPUT_ERROR, tr("CTCP ACTION with unknown person - Desynchronized?")));
275 } 290 }
276 } else { 291 } else {
277 emit outputReady(IRCOutput(OUTPUT_ERROR, tr("CTCP ACTION with unknown channel - Desynchronized?"))); 292 emit outputReady(IRCOutput(OUTPUT_ERROR, tr("CTCP ACTION with unknown channel - Desynchronized?")));
278 } 293 }
279 } else { 294 } else {
280 if (message->ctcpDestination() == m_session->m_server->nick()) { 295 if (message->ctcpDestination() == m_session->m_server->nick()) {
281 IRCPerson *person = m_session->getPerson(mask.nick()); 296 IRCPerson *person = m_session->getPerson(mask.nick());
282 if (!person) { 297 if (!person) {
283 /* Person not yet known, create and add to the current session */ 298 /* Person not yet known, create and add to the current session */
284 person = new IRCPerson(message->prefix()); 299 person = new IRCPerson(message->prefix());
285 m_session->addPerson(person); 300 m_session->addPerson(person);
286 } 301 }
287 IRCOutput output(OUTPUT_QUERYACTION, "*" + mask.nick() + message->param(0)); 302 IRCOutput output(OUTPUT_QUERYACTION, "*" + mask.nick() + message->param(0));
288 output.addParam(person); 303 output.addParam(person);
289 emit outputReady(output); 304 emit outputReady(output);
290 } else { 305 } else {
291 emit outputReady(IRCOutput(OUTPUT_ERROR, tr("CTCP ACTION with bad recipient"))); 306 emit outputReady(IRCOutput(OUTPUT_ERROR, tr("CTCP ACTION with bad recipient")));
292 } 307 }
@@ -439,48 +454,64 @@ void IRCMessageParser::parseNumericalNames(IRCMessage *message) {
439 case '@': flag = PERSON_FLAG_OP; break; 454 case '@': flag = PERSON_FLAG_OP; break;
440 case '+': flag = PERSON_FLAG_VOICE; break; 455 case '+': flag = PERSON_FLAG_VOICE; break;
441 case '%': flag = PERSON_FLAG_HALFOP; break; 456 case '%': flag = PERSON_FLAG_HALFOP; break;
442 default : flag = 0; break; 457 default : flag = 0; break;
443 } 458 }
444 } else { 459 } else {
445 nick = temp; 460 nick = temp;
446 } 461 }
447 462
448 IRCChannelPerson *chan_person = new IRCChannelPerson(); 463 IRCChannelPerson *chan_person = new IRCChannelPerson();
449 IRCPerson *person = m_session->getPerson(nick); 464 IRCPerson *person = m_session->getPerson(nick);
450 if (person == 0) { 465 if (person == 0) {
451 person = new IRCPerson(); 466 person = new IRCPerson();
452 person->setNick(nick); 467 person->setNick(nick);
453 m_session->addPerson(person); 468 m_session->addPerson(person);
454 } 469 }
455 chan_person->person = person; 470 chan_person->person = person;
456 chan_person->flags = flag; 471 chan_person->flags = flag;
457 channel->addPerson(chan_person); 472 channel->addPerson(chan_person);
458 } 473 }
459 } else { 474 } else {
460 emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Server message with unknown channel"))); 475 emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Server message with unknown channel")));
461 } 476 }
462} 477}
463 478
464void IRCMessageParser::parseNumericalEndOfNames(IRCMessage *message) { 479void IRCMessageParser::parseNumericalEndOfNames(IRCMessage *message) {
465 /* Done syncing to channel */ 480 /* Done syncing to channel */
466 IRCChannel *channel = m_session->getChannel(message->param(1)); 481 IRCChannel *channel = m_session->getChannel(message->param(1));
467 if (channel) { 482 if (channel) {
468 channel->setHasPeople(TRUE); 483 channel->setHasPeople(TRUE);
469 /* Yes, we want the names before anything happens inside the GUI */ 484 /* Yes, we want the names before anything happens inside the GUI */
470 IRCOutput output(OUTPUT_SELFJOIN, tr("You joined channel ") + channel->channelname()); 485 IRCOutput output(OUTPUT_SELFJOIN, tr("You joined channel ") + channel->channelname());
471 output.addParam(channel); 486 output.addParam(channel);
472 emit outputReady(output); 487 emit outputReady(output);
473 } else { 488 } else {
474 emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Server message with unknown channel"))); 489 emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Server message with unknown channel")));
475 } 490 }
476} 491}
477 492
478 493
479void IRCMessageParser::parseNumericalNicknameInUse(IRCMessage *) { 494void IRCMessageParser::parseNumericalNicknameInUse(IRCMessage *) {
480 emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Nickname is in use, please reconnect with a different nickname"))); 495 emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Nickname is in use, please reconnect with a different nickname")));
481 m_session->endSession(); 496 m_session->endSession();
482} 497}
483 498
484void IRCMessageParser::parseNumericalNoSuchNick(IRCMessage *) { 499void IRCMessageParser::parseNumericalNoSuchNick(IRCMessage *) {
485 emit outputReady(IRCOutput(OUTPUT_ERROR, tr("No such nickname"))); 500 emit outputReady(IRCOutput(OUTPUT_ERROR, tr("No such nickname")));
486} 501}
502
503void IRCMessageParser::parseNumericalTopic(IRCMessage *message) {
504 IRCChannel *channel = m_session->getChannel(message->param(1));
505 if (channel) {
506 IRCOutput output(OUTPUT_TOPIC, tr("Topic for channel " + channel->channelname() + " is \"" + message->param(2) + "\""));
507 output.addParam(channel);
508 emit outputReady(output);
509 } else {
510 IRCOutput output(OUTPUT_TOPIC, tr("Topic for channel " + message->param(1) + " is \"" + message->param(2) + "\""));
511 output.addParam(0);
512 emit outputReady(output);
513 }
514}
515
516void IRCMessageParser::parseNumericalTopicWhoTime(IRCMessage *message) {
517}
diff --git a/noncore/net/opieirc/ircmessageparser.h b/noncore/net/opieirc/ircmessageparser.h
index f774047..c4dd96c 100644
--- a/noncore/net/opieirc/ircmessageparser.h
+++ b/noncore/net/opieirc/ircmessageparser.h
@@ -27,70 +27,73 @@
27#define FUNC(__proc) &IRCMessageParser::__proc 27#define FUNC(__proc) &IRCMessageParser::__proc
28 28
29class IRCMessageParser; 29class IRCMessageParser;
30 30
31/* Typedef representing a parser function */ 31/* Typedef representing a parser function */
32typedef void (IRCMessageParser::*IRCMessageParseProc)(IRCMessage *); 32typedef void (IRCMessageParser::*IRCMessageParseProc)(IRCMessage *);
33 33
34/* Struct representing a literal command handler */ 34/* Struct representing a literal command handler */
35typedef struct IRCLiteralMessageParserStruct { 35typedef struct IRCLiteralMessageParserStruct {
36 char *commandName; 36 char *commandName;
37 IRCMessageParseProc proc; 37 IRCMessageParseProc proc;
38}; 38};
39 39
40/* Struct representing a ctcp command handler */ 40/* Struct representing a ctcp command handler */
41typedef struct IRCCTCPMessageParserStruct { 41typedef struct IRCCTCPMessageParserStruct {
42 char *commandName; 42 char *commandName;
43 IRCMessageParseProc proc; 43 IRCMessageParseProc proc;
44}; 44};
45 45
46/* Struct representing a numerical command handler */ 46/* Struct representing a numerical command handler */
47typedef struct IRCNumericalMessageParserStruct { 47typedef struct IRCNumericalMessageParserStruct {
48 unsigned short commandNumber; 48 unsigned short commandNumber;
49 IRCMessageParseProc proc; 49 IRCMessageParseProc proc;
50}; 50};
51 51
52class IRCMessageParser : public QObject { 52class IRCMessageParser : public QObject {
53 Q_OBJECT 53 Q_OBJECT
54public: 54public:
55 /* Create an IRCMessageParser object */ 55 /* Create an IRCMessageParser object */
56 IRCMessageParser(IRCSession *session); 56 IRCMessageParser(IRCSession *session);
57 /* Parse a server message and take the appropriate actions */ 57 /* Parse a server message and take the appropriate actions */
58 void parse(IRCMessage *message); 58 void parse(IRCMessage *message);
59signals: 59signals:
60 /* Used to send commands to the UI (such as displaying text etc) */ 60 /* Used to send commands to the UI (such as displaying text etc) */
61 void outputReady(IRCOutput output); 61 void outputReady(IRCOutput output);
62private: 62private:
63 /* Parser functions */ 63 /* Parser functions */
64 void nullFunc(IRCMessage *message); 64 void nullFunc(IRCMessage *message);
65 void parseLiteralPing(IRCMessage *message); 65 void parseLiteralPing(IRCMessage *message);
66 void parseLiteralNotice(IRCMessage *message); 66 void parseLiteralNotice(IRCMessage *message);
67 void parseLiteralJoin(IRCMessage *message); 67 void parseLiteralJoin(IRCMessage *message);
68 void parseLiteralPrivMsg(IRCMessage *message); 68 void parseLiteralPrivMsg(IRCMessage *message);
69 void parseLiteralNick(IRCMessage *message); 69 void parseLiteralNick(IRCMessage *message);
70 void parseLiteralPart(IRCMessage *message); 70 void parseLiteralPart(IRCMessage *message);
71 void parseLiteralQuit(IRCMessage *message); 71 void parseLiteralQuit(IRCMessage *message);
72 void parseLiteralError(IRCMessage *message); 72 void parseLiteralError(IRCMessage *message);
73 void parseLiteralMode(IRCMessage *message); 73 void parseLiteralMode(IRCMessage *message);
74 void parseLiteralKick(IRCMessage *message); 74 void parseLiteralKick(IRCMessage *message);
75 void parseLiteralTopic(IRCMessage *message);
75 void parseNumerical001(IRCMessage *message); 76 void parseNumerical001(IRCMessage *message);
76 void parseNumerical002(IRCMessage *message); 77 void parseNumerical002(IRCMessage *message);
77 void parseNumerical003(IRCMessage *message); 78 void parseNumerical003(IRCMessage *message);
78 void parseNumerical004(IRCMessage *message); 79 void parseNumerical004(IRCMessage *message);
79 void parseNumerical005(IRCMessage *message); 80 void parseNumerical005(IRCMessage *message);
80 void parseNumericalStats(IRCMessage *message); 81 void parseNumericalStats(IRCMessage *message);
81 void parseNumericalNames(IRCMessage *message); 82 void parseNumericalNames(IRCMessage *message);
82 void parseNumericalEndOfNames(IRCMessage *message); 83 void parseNumericalEndOfNames(IRCMessage *message);
83 void parseNumericalNicknameInUse(IRCMessage *message); 84 void parseNumericalNicknameInUse(IRCMessage *message);
84 void parseNumericalNoSuchNick(IRCMessage *message); 85 void parseNumericalNoSuchNick(IRCMessage *message);
86 void parseNumericalTopic(IRCMessage *message);
87 void parseNumericalTopicWhoTime(IRCMessage *message);
85 void parseCTCPPing(IRCMessage *message); 88 void parseCTCPPing(IRCMessage *message);
86 void parseCTCPVersion(IRCMessage *message); 89 void parseCTCPVersion(IRCMessage *message);
87 void parseCTCPAction(IRCMessage *message); 90 void parseCTCPAction(IRCMessage *message);
88protected: 91protected:
89 IRCSession *m_session; 92 IRCSession *m_session;
90 /* Parser tables */ 93 /* Parser tables */
91 static IRCLiteralMessageParserStruct literalParserProcTable[]; 94 static IRCLiteralMessageParserStruct literalParserProcTable[];
92 static IRCNumericalMessageParserStruct numericalParserProcTable[]; 95 static IRCNumericalMessageParserStruct numericalParserProcTable[];
93 static IRCCTCPMessageParserStruct ctcpParserProcTable[]; 96 static IRCCTCPMessageParserStruct ctcpParserProcTable[];
94}; 97};
95 98
96#endif /* __IRCMESSAGEPARSER_H */ 99#endif /* __IRCMESSAGEPARSER_H */
diff --git a/noncore/net/opieirc/ircoutput.h b/noncore/net/opieirc/ircoutput.h
index e8cc524..9c0b8bb 100644
--- a/noncore/net/opieirc/ircoutput.h
+++ b/noncore/net/opieirc/ircoutput.h
@@ -1,74 +1,75 @@
1/* 1/*
2 OpieIRC - An embedded IRC client 2 OpieIRC - An embedded IRC client
3 Copyright (C) 2002 Wenzel Jakob 3 Copyright (C) 2002 Wenzel Jakob
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18
19*/ 19*/
20 20
21#ifndef __IRCOUTPUT_H 21#ifndef __IRCOUTPUT_H
22#define __IRCOUTPUT_H 22#define __IRCOUTPUT_H
23 23
24#include <qstring.h> 24#include <qstring.h>
25#include <qlist.h> 25#include <qlist.h>
26#include "ircchannel.h" 26#include "ircchannel.h"
27 27
28/* Types of possible IRC output */ 28/* Types of possible IRC output */
29enum IRCOutputType { 29enum IRCOutputType {
30 OUTPUT_ERROR = -1, /* parameters : none */ 30 OUTPUT_ERROR = -1, /* parameters : none */
31 OUTPUT_SERVERMESSAGE = 0, /* parameters : none */ 31 OUTPUT_SERVERMESSAGE = 0, /* parameters : none */
32 OUTPUT_CLIENTMESSAGE = 1, /* parameters : none */ 32 OUTPUT_CLIENTMESSAGE = 1, /* parameters : none */
33 OUTPUT_CHANPRIVMSG = 2, /* parameters : channel (IRCChannel), person (IRCChannelPerson) */ 33 OUTPUT_CHANPRIVMSG = 2, /* parameters : channel (IRCChannel), person (IRCChannelPerson) */
34 OUTPUT_QUERYPRIVMSG = 3, /* parameters : person (IRCPerson) */ 34 OUTPUT_QUERYPRIVMSG = 3, /* parameters : person (IRCPerson) */
35 OUTPUT_NICKCHANGE = 4, /* parameters : person (IRCPerson) */ 35 OUTPUT_NICKCHANGE = 4, /* parameters : person (IRCPerson) */
36 OUTPUT_SELFJOIN = 5, /* parameters : channel (IRCChannel) */ 36 OUTPUT_SELFJOIN = 5, /* parameters : channel (IRCChannel) */
37 OUTPUT_OTHERJOIN = 6, /* parameters : channel (IRCChannel), person (IRCChannelPerson) */ 37 OUTPUT_OTHERJOIN = 6, /* parameters : channel (IRCChannel), person (IRCChannelPerson) */
38 OUTPUT_SELFPART = 7, /* parameters : channel (IRCChannel) */ 38 OUTPUT_SELFPART = 7, /* parameters : channel (IRCChannel) */
39 OUTPUT_OTHERPART = 8, /* parameters : channel (IRCChannel), person (IRCChannelPerson) */ 39 OUTPUT_OTHERPART = 8, /* parameters : channel (IRCChannel), person (IRCChannelPerson) */
40 OUTPUT_QUIT = 9, /* parameters : person (IRCPerson) */ 40 OUTPUT_QUIT = 9, /* parameters : person (IRCPerson) */
41 OUTPUT_CONNCLOSE = 10, /* parameters : none */ 41 OUTPUT_CONNCLOSE = 10, /* parameters : none */
42 OUTPUT_CTCP = 11, /* parameters : none */ 42 OUTPUT_CTCP = 11, /* parameters : none */
43 OUTPUT_SELFKICK = 12, /* parameters : channel (IRCChannel) */ 43 OUTPUT_SELFKICK = 12, /* parameters : channel (IRCChannel) */
44 OUTPUT_OTHERKICK = 13, /* parameters : channel (IRCChannel) person (IRCChannelPerson) */ 44 OUTPUT_OTHERKICK = 13, /* parameters : channel (IRCChannel) person (IRCChannelPerson) */
45 OUTPUT_CHANACTION = 14, /* parameters : channel (IRCChannel) person (IRCChannelPerson) */ 45 OUTPUT_CHANACTION = 14, /* parameters : channel (IRCChannel) person (IRCChannelPerson) */
46 OUTPUT_QUERYACTION = 15, /* parameters : person (IRCPerson) */ 46 OUTPUT_QUERYACTION = 15, /* parameters : person (IRCPerson) */
47 OUTPUT_CHANPERSONMODE = 16 /* parameters : channel (IRCCHannel) person (IRCChannelPerson) */ 47 OUTPUT_CHANPERSONMODE = 16, /* parameters : channel (IRCCHannel) person (IRCChannelPerson) */
48 OUTPUT_TOPIC = 17 /* parameters : channel (IRCChannel) */
48}; 49};
49 50
50/* The IRCOutput class is used as a kind of message which is sent by the 51/* The IRCOutput class is used as a kind of message which is sent by the
51 IRC parser to inform the GUI of changes. This could for example be a 52 IRC parser to inform the GUI of changes. This could for example be a
52 channel message or a nickname change */ 53 channel message or a nickname change */
53 54
54class IRCOutput { 55class IRCOutput {
55public: 56public:
56 IRCOutput(IRCOutputType type, QString message); 57 IRCOutput(IRCOutputType type, QString message);
57 /* Used to add a parameter to this IRCOutput. Parameters are dependent 58 /* Used to add a parameter to this IRCOutput. Parameters are dependent
58 on which IRCOutputType we are using (see above) */ 59 on which IRCOutputType we are using (see above) */
59 void addParam(void *data); 60 void addParam(void *data);
60 61
61 IRCOutputType type(); 62 IRCOutputType type();
62 QString message(); 63 QString message();
63 /* Return the message with all HTML code escaped (for example &lt; instead of '<') */ 64 /* Return the message with all HTML code escaped (for example &lt; instead of '<') */
64 QString htmlMessage(); 65 QString htmlMessage();
65 66
66 static QString toHTML(QString message); 67 static QString toHTML(QString message);
67 void *getParam(int index); 68 void *getParam(int index);
68protected: 69protected:
69 IRCOutputType m_type; 70 IRCOutputType m_type;
70 QString m_message; 71 QString m_message;
71 QList<void> m_parameters; 72 QList<void> m_parameters;
72}; 73};
73 74
74#endif 75#endif
diff --git a/noncore/net/opieirc/ircservertab.cpp b/noncore/net/opieirc/ircservertab.cpp
index 4be60ef..aea58a3 100644
--- a/noncore/net/opieirc/ircservertab.cpp
+++ b/noncore/net/opieirc/ircservertab.cpp
@@ -174,79 +174,91 @@ void IRCServerTab::display(IRCOutput output) {
174 } else { 174 } else {
175 appendText("<font color=\"" + m_errorColor + "\">" + output.htmlMessage() +"</font><br>"); 175 appendText("<font color=\"" + m_errorColor + "\">" + output.htmlMessage() +"</font><br>");
176 QListIterator<IRCChannelTab> it(m_channelTabs); 176 QListIterator<IRCChannelTab> it(m_channelTabs);
177 for (; it.current(); ++it) { 177 for (; it.current(); ++it) {
178 it.current()->appendText("<font color=\"" + m_serverColor + "\">" + output.htmlMessage() +"</font><br>"); 178 it.current()->appendText("<font color=\"" + m_serverColor + "\">" + output.htmlMessage() +"</font><br>");
179 } 179 }
180 } 180 }
181 break; 181 break;
182 case OUTPUT_SELFJOIN: { 182 case OUTPUT_SELFJOIN: {
183 IRCChannelTab *channeltab = new IRCChannelTab((IRCChannel *)output.getParam(0), this, m_mainWindow, (QWidget *)parent()); 183 IRCChannelTab *channeltab = new IRCChannelTab((IRCChannel *)output.getParam(0), this, m_mainWindow, (QWidget *)parent());
184 m_channelTabs.append(channeltab); 184 m_channelTabs.append(channeltab);
185 m_mainWindow->addTab(channeltab); 185 m_mainWindow->addTab(channeltab);
186 } 186 }
187 break; 187 break;
188 case OUTPUT_CHANPRIVMSG: { 188 case OUTPUT_CHANPRIVMSG: {
189 IRCChannelTab *channelTab = getTabForChannel((IRCChannel *)output.getParam(0)); 189 IRCChannelTab *channelTab = getTabForChannel((IRCChannel *)output.getParam(0));
190 channelTab->appendText("<font color=\"" + m_textColor + "\">&lt;</font><font color=\"" + m_otherColor + "\">"+IRCOutput::toHTML(((IRCChannelPerson *)output.getParam(1))->person->nick())+"</font><font color=\"" + m_textColor + "\">&gt; " + output.htmlMessage()+"</font><br>"); 190 channelTab->appendText("<font color=\"" + m_textColor + "\">&lt;</font><font color=\"" + m_otherColor + "\">"+IRCOutput::toHTML(((IRCChannelPerson *)output.getParam(1))->person->nick())+"</font><font color=\"" + m_textColor + "\">&gt; " + output.htmlMessage()+"</font><br>");
191 } 191 }
192 break; 192 break;
193 case OUTPUT_QUERYACTION: 193 case OUTPUT_QUERYACTION:
194 case OUTPUT_QUERYPRIVMSG: { 194 case OUTPUT_QUERYPRIVMSG: {
195 IRCQueryTab *queryTab = getTabForQuery((IRCPerson *)output.getParam(0)); 195 IRCQueryTab *queryTab = getTabForQuery((IRCPerson *)output.getParam(0));
196 if (!queryTab) { 196 if (!queryTab) {
197 queryTab = new IRCQueryTab((IRCPerson *)output.getParam(0), this, m_mainWindow, (QWidget *)parent()); 197 queryTab = new IRCQueryTab((IRCPerson *)output.getParam(0), this, m_mainWindow, (QWidget *)parent());
198 m_queryTabs.append(queryTab); 198 m_queryTabs.append(queryTab);
199 m_mainWindow->addTab(queryTab); 199 m_mainWindow->addTab(queryTab);
200 } 200 }
201 queryTab->display(output); 201 queryTab->display(output);
202 } 202 }
203 break; 203 break;
204 case OUTPUT_SELFPART: { 204 case OUTPUT_SELFPART: {
205 IRCChannelTab *channelTab = getTabForChannel((IRCChannel *)output.getParam(0)); 205 IRCChannelTab *channelTab = getTabForChannel((IRCChannel *)output.getParam(0));
206 if (channelTab) 206 if (channelTab)
207 m_mainWindow->killTab(channelTab); 207 m_mainWindow->killTab(channelTab);
208 } 208 }
209 break; 209 break;
210 case OUTPUT_SELFKICK: { 210 case OUTPUT_SELFKICK: {
211 appendText("<font color=\"" + m_errorColor + "\">" + output.htmlMessage() + "</font><br>"); 211 appendText("<font color=\"" + m_errorColor + "\">" + output.htmlMessage() + "</font><br>");
212 IRCChannelTab *channelTab = getTabForChannel((IRCChannel *)output.getParam(0)); 212 IRCChannelTab *channelTab = getTabForChannel((IRCChannel *)output.getParam(0));
213 if (channelTab) 213 if (channelTab)
214 m_mainWindow->killTab(channelTab); 214 m_mainWindow->killTab(channelTab);
215 } 215 }
216 break; 216 break;
217 case OUTPUT_CHANACTION: { 217 case OUTPUT_CHANACTION: {
218 IRCChannelTab *channelTab = getTabForChannel((IRCChannel *)output.getParam(0)); 218 IRCChannelTab *channelTab = getTabForChannel((IRCChannel *)output.getParam(0));
219 channelTab->appendText("<font color=\"" + m_otherColor + "\">"+output.htmlMessage()+"</font><br>"); 219 channelTab->appendText("<font color=\"" + m_otherColor + "\">"+output.htmlMessage()+"</font><br>");
220 } 220 }
221 break; 221 break;
222 case OUTPUT_TOPIC: {
223 IRCChannel *channel = (IRCChannel *) output.getParam(0);
224 if (channel) {
225 IRCChannelTab *channelTab = getTabForChannel(channel);
226 if (channelTab) {
227 channelTab->appendText("<font color=\"" + m_notificationColor + "\">"+output.htmlMessage()+"</font><br>");
228 return;
229 }
230 }
231 appendText("<font color=\"" + m_notificationColor + "\">"+output.htmlMessage()+"</font><br>");
232 }
233 break;
222 case OUTPUT_QUIT: { 234 case OUTPUT_QUIT: {
223 QString nick = ((IRCPerson *)output.getParam(0))->nick(); 235 QString nick = ((IRCPerson *)output.getParam(0))->nick();
224 QListIterator<IRCChannelTab> it(m_channelTabs); 236 QListIterator<IRCChannelTab> it(m_channelTabs);
225 for (; it.current(); ++it) { 237 for (; it.current(); ++it) {
226 if (it.current()->list()->hasPerson(nick)) { 238 if (it.current()->list()->hasPerson(nick)) {
227 it.current()->appendText("<font color=\"" + m_notificationColor + "\">"+output.htmlMessage()+"</font><br>"); 239 it.current()->appendText("<font color=\"" + m_notificationColor + "\">"+output.htmlMessage()+"</font><br>");
228 it.current()->list()->update(); 240 it.current()->list()->update();
229 } 241 }
230 } 242 }
231 } 243 }
232 break; 244 break;
233 case OUTPUT_OTHERJOIN: 245 case OUTPUT_OTHERJOIN:
234 case OUTPUT_OTHERKICK: 246 case OUTPUT_OTHERKICK:
235 case OUTPUT_CHANPERSONMODE: 247 case OUTPUT_CHANPERSONMODE:
236 case OUTPUT_OTHERPART: { 248 case OUTPUT_OTHERPART: {
237 IRCChannelTab *channelTab = getTabForChannel((IRCChannel *)output.getParam(0)); 249 IRCChannelTab *channelTab = getTabForChannel((IRCChannel *)output.getParam(0));
238 channelTab->appendText("<font color=\"" + m_notificationColor + "\">"+output.htmlMessage()+"</font><br>"); 250 channelTab->appendText("<font color=\"" + m_notificationColor + "\">"+output.htmlMessage()+"</font><br>");
239 channelTab->list()->update(); 251 channelTab->list()->update();
240 } 252 }
241 break; 253 break;
242 case OUTPUT_CTCP: 254 case OUTPUT_CTCP:
243 appendText("<font color=\"" + m_notificationColor + "\">" + output.htmlMessage() + "</font><br>"); 255 appendText("<font color=\"" + m_notificationColor + "\">" + output.htmlMessage() + "</font><br>");
244 break; 256 break;
245 case OUTPUT_ERROR: 257 case OUTPUT_ERROR:
246 appendText("<font color=\"" + m_errorColor + "\">" + output.htmlMessage() + "</font><br>"); 258 appendText("<font color=\"" + m_errorColor + "\">" + output.htmlMessage() + "</font><br>");
247 break; 259 break;
248 default: 260 default:
249 appendText("<font color=\"" + m_serverColor + "\">" + output.htmlMessage() + "</font><br>"); 261 appendText("<font color=\"" + m_serverColor + "\">" + output.htmlMessage() + "</font><br>");
250 break; 262 break;
251 } 263 }
252} 264}