summaryrefslogtreecommitdiff
path: root/noncore/net/opieirc/ircmessageparser.cpp
Unidiff
Diffstat (limited to 'noncore/net/opieirc/ircmessageparser.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieirc/ircmessageparser.cpp33
1 files changed, 32 insertions, 1 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
@@ -17,2 +17,3 @@ IRCLiteralMessageParserStruct IRCMessageParser::literalParserProcTable[] = {
17 { "KICK", FUNC(parseLiteralKick) }, 17 { "KICK", FUNC(parseLiteralKick) },
18 { "TOPIC", FUNC(parseLiteralTopic) },
18 { 0 , 0 } 19 { 0 , 0 }
@@ -38,2 +39,4 @@ IRCNumericalMessageParserStruct IRCMessageParser::numericalParserProcTable[] = {
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
@@ -193,3 +196,3 @@ void IRCMessageParser::parseLiteralPrivMsg(IRCMessage *message) {
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 }
@@ -244,2 +247,14 @@ void IRCMessageParser::parseLiteralQuit(IRCMessage *message) {
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) {
@@ -486 +501,17 @@ void IRCMessageParser::parseNumericalNoSuchNick(IRCMessage *) {
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}