Diffstat (limited to 'noncore/net/opieirc/ircmessageparser.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opieirc/ircmessageparser.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/noncore/net/opieirc/ircmessageparser.cpp b/noncore/net/opieirc/ircmessageparser.cpp index 90280d7..ecc7e9a 100644 --- a/noncore/net/opieirc/ircmessageparser.cpp +++ b/noncore/net/opieirc/ircmessageparser.cpp | |||
@@ -284,4 +284,38 @@ void IRCMessageParser::parseCTCPPing(IRCMessage *message) { | |||
284 | m_session->m_connection->sendCTCP(mask.nick(), "PING " + message->allParameters()); | 284 | m_session->m_connection->sendCTCP(mask.nick(), "PING " + message->allParameters()); |
285 | emit outputReady(IRCOutput(OUTPUT_CTCP, tr("Received a CTCP PING from ")+mask.nick())); | 285 | emit outputReady(IRCOutput(OUTPUT_CTCP, tr("Received a CTCP PING from ")+mask.nick())); |
286 | |||
287 | //IRCPerson mask(message->prefix()); | ||
288 | QString dest = message->ctcpDestination(); | ||
289 | if (dest.startsWith("#")) { | ||
290 | IRCChannel *channel = m_session->getChannel(dest.lower()); | ||
291 | if (channel) { | ||
292 | IRCChannelPerson *person = channel->getPerson(mask.nick()); | ||
293 | if (person) { | ||
294 | IRCOutput output(OUTPUT_CHANACTION, tr("Received a CTCP PING from ")+ mask.nick()) ; | ||
295 | output.addParam(channel); | ||
296 | output.addParam(person); | ||
297 | emit outputReady(output); | ||
298 | } else { | ||
299 | emit outputReady(IRCOutput(OUTPUT_ERROR, tr("CTCP PING with unknown person - Desynchronized?"))); | ||
300 | } | ||
301 | } else { | ||
302 | emit outputReady(IRCOutput(OUTPUT_ERROR, tr("CTCP PING with unknown channel - Desynchronized?"))); | ||
303 | } | ||
304 | } else { | ||
305 | if (message->ctcpDestination() == m_session->m_server->nick()) { | ||
306 | IRCPerson *person = m_session->getPerson(mask.nick()); | ||
307 | if (!person) { | ||
308 | /* Person not yet known, create and add to the current session */ | ||
309 | person = new IRCPerson(message->prefix()); | ||
310 | m_session->addPerson(person); | ||
311 | } | ||
312 | IRCOutput output(OUTPUT_QUERYACTION, tr("Received a CTCP PING from ")+ mask.nick() ); | ||
313 | output.addParam(person); | ||
314 | emit outputReady(output); | ||
315 | } else { | ||
316 | emit outputReady(IRCOutput(OUTPUT_ERROR, tr("CTCP PING with bad recipient"))); | ||
317 | } | ||
318 | } | ||
319 | |||
286 | } | 320 | } |
287 | 321 | ||