summaryrefslogtreecommitdiff
authorwazlaf <wazlaf>2002-09-29 20:06:27 (UTC)
committer wazlaf <wazlaf>2002-09-29 20:06:27 (UTC)
commit84c3b7409eb543066e42816328cc3f0a26d413cc (patch) (unidiff)
treea2b8b8c7f7d56bdcffaa54f2c5e03ce08e184a81
parent1dd254c95a582c2c86c816516a1b4433d8142d8a (diff)
downloadopie-84c3b7409eb543066e42816328cc3f0a26d413cc.zip
opie-84c3b7409eb543066e42816328cc3f0a26d413cc.tar.gz
opie-84c3b7409eb543066e42816328cc3f0a26d413cc.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.cpp26
1 files changed, 15 insertions, 11 deletions
diff --git a/noncore/net/opieirc/ircmessageparser.cpp b/noncore/net/opieirc/ircmessageparser.cpp
index d1b70a5..2b77414 100644
--- a/noncore/net/opieirc/ircmessageparser.cpp
+++ b/noncore/net/opieirc/ircmessageparser.cpp
@@ -35,6 +35,10 @@ IRCNumericalMessageParserStruct IRCMessageParser::numericalParserProcTable[] = {
35 { 4, FUNC(parseNumerical004) }, // RPL_MYINFO 35 { 4, FUNC(parseNumerical004) }, // RPL_MYINFO
36 { 5, FUNC(parseNumerical005) }, // RPL_BOUNCE, RPL_PROTOCTL 36 { 5, FUNC(parseNumerical005) }, // RPL_BOUNCE, RPL_PROTOCTL
37 { 251, FUNC(parseNumericalStats) }, // RPL_LUSERCLIENT 37 { 251, FUNC(parseNumericalStats) }, // RPL_LUSERCLIENT
38 { 252, FUNC(parseNumericalStats) }, // RPL_LUSEROP
39 { 265, FUNC(parseNumericalStats) }, // RPL_LOCALUSERS
40 { 266, FUNC(parseNumericalStats) }, // RPL_GLOBALUSERS
41 { 250, FUNC(parseNumericalStats) }, // RPL_STATSCONN
38 { 254, FUNC(nullFunc)}, // RPL_LUSERCHANNELS 42 { 254, FUNC(nullFunc)}, // RPL_LUSERCHANNELS
39 { 255, FUNC(parseNumericalStats) }, // RPL_LUSERNAME 43 { 255, FUNC(parseNumericalStats) }, // RPL_LUSERNAME
40 { 332, FUNC(parseNumericalTopic) }, // RPL_TOPIC 44 { 332, FUNC(parseNumericalTopic) }, // RPL_TOPIC
@@ -100,7 +104,7 @@ void IRCMessageParser::parseLiteralNotice(IRCMessage *message) {
100} 104}
101 105
102void IRCMessageParser::parseLiteralJoin(IRCMessage *message) { 106void IRCMessageParser::parseLiteralJoin(IRCMessage *message) {
103 QString channelName = message->param(0); 107 QString channelName = message->param(0).lower();
104 IRCPerson mask(message->prefix()); 108 IRCPerson mask(message->prefix());
105 IRCChannel *channel = m_session->getChannel(channelName); 109 IRCChannel *channel = m_session->getChannel(channelName);
106 if (!channel) { 110 if (!channel) {
@@ -138,7 +142,7 @@ void IRCMessageParser::parseLiteralJoin(IRCMessage *message) {
138} 142}
139 143
140void IRCMessageParser::parseLiteralPart(IRCMessage *message) { 144void IRCMessageParser::parseLiteralPart(IRCMessage *message) {
141 QString channelName = message->param(0); 145 QString channelName = message->param(0).lower();
142 IRCChannel *channel = m_session->getChannel(channelName); 146 IRCChannel *channel = m_session->getChannel(channelName);
143 IRCPerson mask(message->prefix()); 147 IRCPerson mask(message->prefix());
144 if (channel) { 148 if (channel) {
@@ -181,7 +185,7 @@ void IRCMessageParser::parseLiteralPrivMsg(IRCMessage *message) {
181 emit outputReady(output); 185 emit outputReady(output);
182 } else if (message->param(0).at(0) == '#') { 186 } else if (message->param(0).at(0) == '#') {
183 /* IRC Channel message detected, verify sender, channel and display it */ 187 /* IRC Channel message detected, verify sender, channel and display it */
184 IRCChannel *channel = m_session->getChannel(message->param(0)); 188 IRCChannel *channel = m_session->getChannel(message->param(0).lower());
185 if (channel) { 189 if (channel) {
186 IRCPerson mask(message->prefix()); 190 IRCPerson mask(message->prefix());
187 IRCChannelPerson *person = channel->getPerson(mask.nick()); 191 IRCChannelPerson *person = channel->getPerson(mask.nick());
@@ -194,7 +198,7 @@ void IRCMessageParser::parseLiteralPrivMsg(IRCMessage *message) {
194 emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Channel message with unknown sender"))); 198 emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Channel message with unknown sender")));
195 } 199 }
196 } else { 200 } else {
197 emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Channel message with unknown channel ") + message->param(0))); 201 emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Channel message with unknown channel ") + message->param(0).lower()));
198 } 202 }
199 } else { 203 } else {
200 emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Received PRIVMSG of unknown type"))); 204 emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Received PRIVMSG of unknown type")));
@@ -247,7 +251,7 @@ void IRCMessageParser::parseLiteralQuit(IRCMessage *message) {
247 251
248void IRCMessageParser::parseLiteralTopic(IRCMessage *message) { 252void IRCMessageParser::parseLiteralTopic(IRCMessage *message) {
249 IRCPerson mask(message->prefix()); 253 IRCPerson mask(message->prefix());
250 IRCChannel *channel = m_session->getChannel(message->param(0)); 254 IRCChannel *channel = m_session->getChannel(message->param(0).lower());
251 if (channel) { 255 if (channel) {
252 IRCOutput output(OUTPUT_TOPIC, mask.nick() + tr(" changed topic to ") + "\"" + message->param(1) + "\""); 256 IRCOutput output(OUTPUT_TOPIC, mask.nick() + tr(" changed topic to ") + "\"" + message->param(1) + "\"");
253 output.addParam(channel); 257 output.addParam(channel);
@@ -277,7 +281,7 @@ void IRCMessageParser::parseCTCPAction(IRCMessage *message) {
277 IRCPerson mask(message->prefix()); 281 IRCPerson mask(message->prefix());
278 QString dest = message->ctcpDestination(); 282 QString dest = message->ctcpDestination();
279 if (dest.startsWith("#")) { 283 if (dest.startsWith("#")) {
280 IRCChannel *channel = m_session->getChannel(dest); 284 IRCChannel *channel = m_session->getChannel(dest.lower());
281 if (channel) { 285 if (channel) {
282 IRCChannelPerson *person = channel->getPerson(mask.nick()); 286 IRCChannelPerson *person = channel->getPerson(mask.nick());
283 if (person) { 287 if (person) {
@@ -312,7 +316,7 @@ void IRCMessageParser::parseLiteralMode(IRCMessage *message) {
312 IRCPerson mask(message->prefix()); 316 IRCPerson mask(message->prefix());
313 317
314 if (message->param(0).startsWith("#")) { 318 if (message->param(0).startsWith("#")) {
315 IRCChannel *channel = m_session->getChannel(message->param(0)); 319 IRCChannel *channel = m_session->getChannel(message->param(0).lower());
316 if (channel) { 320 if (channel) {
317 QString temp, parameters = message->allParameters().right(message->allParameters().length() - channel->channelname().length() - 1); 321 QString temp, parameters = message->allParameters().right(message->allParameters().length() - channel->channelname().length() - 1);
318 QTextIStream stream(&parameters); 322 QTextIStream stream(&parameters);
@@ -383,7 +387,7 @@ void IRCMessageParser::parseLiteralMode(IRCMessage *message) {
383 387
384void IRCMessageParser::parseLiteralKick(IRCMessage *message) { 388void IRCMessageParser::parseLiteralKick(IRCMessage *message) {
385 IRCPerson mask(message->prefix()); 389 IRCPerson mask(message->prefix());
386 IRCChannel *channel = m_session->getChannel(message->param(0)); 390 IRCChannel *channel = m_session->getChannel(message->param(0).lower());
387 if (channel) { 391 if (channel) {
388 IRCChannelPerson *person = channel->getPerson(message->param(1)); 392 IRCChannelPerson *person = channel->getPerson(message->param(1));
389 if (person) { 393 if (person) {
@@ -434,7 +438,7 @@ void IRCMessageParser::parseNumericalStats(IRCMessage *message) {
434 438
435void IRCMessageParser::parseNumericalNames(IRCMessage *message) { 439void IRCMessageParser::parseNumericalNames(IRCMessage *message) {
436 /* Name list sent when joining a channel */ 440 /* Name list sent when joining a channel */
437 IRCChannel *channel = m_session->getChannel(message->param(2)); 441 IRCChannel *channel = m_session->getChannel(message->param(2).lower());
438 if (channel != 0) { 442 if (channel != 0) {
439 QString people = message->param(3); 443 QString people = message->param(3);
440 QTextIStream stream(&people); 444 QTextIStream stream(&people);
@@ -478,7 +482,7 @@ void IRCMessageParser::parseNumericalNames(IRCMessage *message) {
478 482
479void IRCMessageParser::parseNumericalEndOfNames(IRCMessage *message) { 483void IRCMessageParser::parseNumericalEndOfNames(IRCMessage *message) {
480 /* Done syncing to channel */ 484 /* Done syncing to channel */
481 IRCChannel *channel = m_session->getChannel(message->param(1)); 485 IRCChannel *channel = m_session->getChannel(message->param(1).lower());
482 if (channel) { 486 if (channel) {
483 channel->setHasPeople(TRUE); 487 channel->setHasPeople(TRUE);
484 /* Yes, we want the names before anything happens inside the GUI */ 488 /* Yes, we want the names before anything happens inside the GUI */
@@ -501,7 +505,7 @@ void IRCMessageParser::parseNumericalNoSuchNick(IRCMessage *) {
501} 505}
502 506
503void IRCMessageParser::parseNumericalTopic(IRCMessage *message) { 507void IRCMessageParser::parseNumericalTopic(IRCMessage *message) {
504 IRCChannel *channel = m_session->getChannel(message->param(1)); 508 IRCChannel *channel = m_session->getChannel(message->param(1).lower());
505 if (channel) { 509 if (channel) {
506 IRCOutput output(OUTPUT_TOPIC, tr("Topic for channel " + channel->channelname() + " is \"" + message->param(2) + "\"")); 510 IRCOutput output(OUTPUT_TOPIC, tr("Topic for channel " + channel->channelname() + " is \"" + message->param(2) + "\""));
507 output.addParam(channel); 511 output.addParam(channel);