author | skyhusker <skyhusker> | 2005-06-09 17:30:09 (UTC) |
---|---|---|
committer | skyhusker <skyhusker> | 2005-06-09 17:30:09 (UTC) |
commit | 2ed64fcf5a3c93ce613e63461cb925568c7df887 (patch) (unidiff) | |
tree | ac95266cc27b3bd50e374ab718aadf243ce99524 | |
parent | 6be140832d97bb485ba98bc9ea0f5cf622330595 (diff) | |
download | opie-2ed64fcf5a3c93ce613e63461cb925568c7df887.zip opie-2ed64fcf5a3c93ce613e63461cb925568c7df887.tar.gz opie-2ed64fcf5a3c93ce613e63461cb925568c7df887.tar.bz2 |
Fix #1667
-rw-r--r-- | noncore/net/opieirc/ircmessageparser.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/noncore/net/opieirc/ircmessageparser.cpp b/noncore/net/opieirc/ircmessageparser.cpp index 939cdae..32e1011 100644 --- a/noncore/net/opieirc/ircmessageparser.cpp +++ b/noncore/net/opieirc/ircmessageparser.cpp | |||
@@ -67,24 +67,25 @@ IRCNumericalMessageParserStruct IRCMessageParser::numericalParserProcTable[] = { | |||
67 | { 332, 0, 0, FUNC(parseNumericalTopic) }, // RPL_TOPIC | 67 | { 332, 0, 0, FUNC(parseNumericalTopic) }, // RPL_TOPIC |
68 | { 333, 0, 0, FUNC(parseNumericalTopicWhoTime) }, // RPL_TOPICWHOTIME*/ | 68 | { 333, 0, 0, FUNC(parseNumericalTopicWhoTime) }, // RPL_TOPICWHOTIME*/ |
69 | { 353, QT_TR_NOOP("Names for %1: %2"), "2,3", FUNC(parseNumericalNames) }, // RPL_NAMREPLY | 69 | { 353, QT_TR_NOOP("Names for %1: %2"), "2,3", FUNC(parseNumericalNames) }, // RPL_NAMREPLY |
70 | { 366, "%1 :%2", "1,2", FUNC(parseNumericalEndOfNames) }, // RPL_ENDOFNAMES | 70 | { 366, "%1 :%2", "1,2", FUNC(parseNumericalEndOfNames) }, // RPL_ENDOFNAMES |
71 | { 369, "%1 :%2", "1,2", 0 }, // RPL_ENDOFWHOWAS | 71 | { 369, "%1 :%2", "1,2", 0 }, // RPL_ENDOFWHOWAS |
72 | { 372, "%1", "1", 0 }, // RPL_MOTD | 72 | { 372, "%1", "1", 0 }, // RPL_MOTD |
73 | { 375, "%1", "1", 0 }, // RPL_MOTDSTART | 73 | { 375, "%1", "1", 0 }, // RPL_MOTDSTART |
74 | { 376, "%1", "1", 0 }, // RPL_ENDOFMOTD | 74 | { 376, "%1", "1", 0 }, // RPL_ENDOFMOTD |
75 | { 377, "%1", "1", 0 }, // RPL_MOTD2 | 75 | { 377, "%1", "1", 0 }, // RPL_MOTD2 |
76 | { 378, "%1", "1", 0 }, // RPL_MOTD3 | 76 | { 378, "%1", "1", 0 }, // RPL_MOTD3 |
77 | { 391, QT_TR_NOOP("Time on server %1 is %2"), "1,2", 0 }, // RPL_TIME | 77 | { 391, QT_TR_NOOP("Time on server %1 is %2"), "1,2", 0 }, // RPL_TIME |
78 | { 401, QT_TR_NOOP("Channel or nick %1 doesn't exists"), "1", 0 }, // ERR_NOSUCHNICK | 78 | { 401, QT_TR_NOOP("Channel or nick %1 doesn't exists"), "1", 0 }, // ERR_NOSUCHNICK |
79 | { 403, QT_TR_NOOP("Channel %1 doesn't exists"), "1", 0 }, // ERR_ERR_NOSUCHCHANNEL | ||
79 | { 406, QT_TR_NOOP("There is no history information for %1"), "1", 0 }, // ERR_WASNOSUCHNICK | 80 | { 406, QT_TR_NOOP("There is no history information for %1"), "1", 0 }, // ERR_WASNOSUCHNICK |
80 | { 409, "%1", "1", 0 }, // ERR_NOORIGIN | 81 | { 409, "%1", "1", 0 }, // ERR_NOORIGIN |
81 | { 411, "%1", "1", 0 }, // ERR_NORECIPIENT | 82 | { 411, "%1", "1", 0 }, // ERR_NORECIPIENT |
82 | { 412, "%1", "1", 0 }, // ERR_NOTEXTTOSEND | 83 | { 412, "%1", "1", 0 }, // ERR_NOTEXTTOSEND |
83 | { 421, QT_TR_NOOP("Unknown command: %1"), "1", 0 }, // ERR_ERR_UNKNOWNCOMMAND | 84 | { 421, QT_TR_NOOP("Unknown command: %1"), "1", 0 }, // ERR_ERR_UNKNOWNCOMMAND |
84 | { 422, "%1", "1", 0 }, // ERR_NOMOTD | 85 | { 422, "%1", "1", 0 }, // ERR_NOMOTD |
85 | { 433, QT_TR_NOOP("Can't change nick to %1: %2"), "1,2", FUNC(parseNumericalNicknameInUse) }, // ERR_NICKNAMEINUSE | 86 | { 433, QT_TR_NOOP("Can't change nick to %1: %2"), "1,2", FUNC(parseNumericalNicknameInUse) }, // ERR_NICKNAMEINUSE |
86 | { 442, QT_TR_NOOP("You're not on channel %1"), "1", 0}, // ERR_NOTONCHANNEL | 87 | { 442, QT_TR_NOOP("You're not on channel %1"), "1", 0}, // ERR_NOTONCHANNEL |
87 | { 477, "%1", "1", 0 }, // ERR_NOCHANMODES || ERR_NEEDREGGEDNICK | 88 | { 477, "%1", "1", 0 }, // ERR_NOCHANMODES || ERR_NEEDREGGEDNICK |
88 | { 482, QT_TR_NOOP("[%1] Operation not permitted, you don't have enough channel privileges"), "1", 0 }, //ERR_CHANOPRIVSNEEDED | 89 | { 482, QT_TR_NOOP("[%1] Operation not permitted, you don't have enough channel privileges"), "1", 0 }, //ERR_CHANOPRIVSNEEDED |
89 | { 0, 0, 0, 0 } | 90 | { 0, 0, 0, 0 } |
90 | }; | 91 | }; |
@@ -260,25 +261,25 @@ void IRCMessageParser::parseLiteralPrivMsg(IRCMessage *message) { | |||
260 | IRCPerson mask(message->prefix()); | 261 | IRCPerson mask(message->prefix()); |
261 | IRCPerson *person = m_session->getPerson(mask.nick()); | 262 | IRCPerson *person = m_session->getPerson(mask.nick()); |
262 | if (!person) { | 263 | if (!person) { |
263 | /* Person not yet known, create and add to the current session */ | 264 | /* Person not yet known, create and add to the current session */ |
264 | person = new IRCPerson(message->prefix()); | 265 | person = new IRCPerson(message->prefix()); |
265 | m_session->addPerson(person); | 266 | m_session->addPerson(person); |
266 | } | 267 | } |
267 | IRCOutput output(OUTPUT_QUERYPRIVMSG, message->param(1)); | 268 | IRCOutput output(OUTPUT_QUERYPRIVMSG, message->param(1)); |
268 | output.addParam(person); | 269 | output.addParam(person); |
269 | emit outputReady(output); | 270 | emit outputReady(output); |
270 | } | 271 | } |
271 | else | 272 | else |
272 | if (message->param(0).at(0) == '#' || message->param(0).at(0) == '+') { | 273 | if (IRCChannel::isValid(message->param(0))) { |
273 | /* IRC Channel message detected, verify sender, channel and display it */ | 274 | /* IRC Channel message detected, verify sender, channel and display it */ |
274 | IRCChannel *channel = m_session->getChannel(message->param(0).lower()); | 275 | IRCChannel *channel = m_session->getChannel(message->param(0).lower()); |
275 | if (channel) { | 276 | if (channel) { |
276 | IRCPerson mask(message->prefix()); | 277 | IRCPerson mask(message->prefix()); |
277 | IRCChannelPerson *person = channel->getPerson(mask.nick()); | 278 | IRCChannelPerson *person = channel->getPerson(mask.nick()); |
278 | if (person) { | 279 | if (person) { |
279 | IRCOutput output(OUTPUT_CHANPRIVMSG, message->param(1)); | 280 | IRCOutput output(OUTPUT_CHANPRIVMSG, message->param(1)); |
280 | output.addParam(channel); | 281 | output.addParam(channel); |
281 | output.addParam(person); | 282 | output.addParam(person); |
282 | emit outputReady(output); | 283 | emit outputReady(output); |
283 | } | 284 | } |
284 | else { | 285 | else { |
@@ -481,25 +482,25 @@ void IRCMessageParser::parseCTCPDCC(IRCMessage *message) { | |||
481 | if(filename.isEmpty()) | 482 | if(filename.isEmpty()) |
482 | return; | 483 | return; |
483 | 484 | ||
484 | odebug << "Receiving file " << filename << " from " << nickname << oendl; | 485 | odebug << "Receiving file " << filename << " from " << nickname << oendl; |
485 | static_cast<IRCServerTab*>(m_session->parent())->mainwindow()->addDCC(DCCTransfer::Recv, params[2].toUInt(), params[3].toUInt(), | 486 | static_cast<IRCServerTab*>(m_session->parent())->mainwindow()->addDCC(DCCTransfer::Recv, params[2].toUInt(), params[3].toUInt(), |
486 | filename, nickname, params[4].toUInt()); | 487 | filename, nickname, params[4].toUInt()); |
487 | } | 488 | } |
488 | } | 489 | } |
489 | 490 | ||
490 | void IRCMessageParser::parseLiteralMode(IRCMessage *message) { | 491 | void IRCMessageParser::parseLiteralMode(IRCMessage *message) { |
491 | IRCPerson mask(message->prefix()); | 492 | IRCPerson mask(message->prefix()); |
492 | 493 | ||
493 | if (message->param(0).startsWith("#")) { | 494 | if (IRCChannel::isValid(message->param(0))) { |
494 | IRCChannel *channel = m_session->getChannel(message->param(0).lower()); | 495 | IRCChannel *channel = m_session->getChannel(message->param(0).lower()); |
495 | if (channel) { | 496 | if (channel) { |
496 | QString temp, parameters = message->allParameters().right(message->allParameters().length() - channel->channelname().length() - 1); | 497 | QString temp, parameters = message->allParameters().right(message->allParameters().length() - channel->channelname().length() - 1); |
497 | QTextIStream stream(¶meters); | 498 | QTextIStream stream(¶meters); |
498 | bool set = FALSE; | 499 | bool set = FALSE; |
499 | while (!stream.atEnd()) { | 500 | while (!stream.atEnd()) { |
500 | stream >> temp; | 501 | stream >> temp; |
501 | if (temp.startsWith("+")) { | 502 | if (temp.startsWith("+")) { |
502 | set = TRUE; | 503 | set = TRUE; |
503 | temp = temp.right(1); | 504 | temp = temp.right(1); |
504 | } | 505 | } |
505 | else | 506 | else |