author | zecke <zecke> | 2004-09-08 21:51:06 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-09-08 21:51:06 (UTC) |
commit | ebb830522c9662bda4c4453e532bcc29631c5d60 (patch) (unidiff) | |
tree | 5cf95975e91cb2db78be5cdf47c01a340109c1f4 /noncore/net/opieirc/ircmessageparser.cpp | |
parent | f0fdb800d57e9a1d95ba593185e9462300539eea (diff) | |
download | opie-ebb830522c9662bda4c4453e532bcc29631c5d60.zip opie-ebb830522c9662bda4c4453e532bcc29631c5d60.tar.gz opie-ebb830522c9662bda4c4453e532bcc29631c5d60.tar.bz2 |
-Close Tab Keyboard Accelerator with delayed deletion of the tab
-Optionally add a TimeStamp to the Tab
-Remove not implemented CTCP actions from the Channel PopupMenu
-Give Focus to the Edit Line
-Some more ping handling
patch inspired and copied from zautrix fork
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 | |||
@@ -274,24 +274,58 @@ void IRCMessageParser::parseLiteralTopic(IRCMessage *message) { | |||
274 | emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Unknown channel topic - desynchronized?"))); | 274 | emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Unknown channel topic - desynchronized?"))); |
275 | } | 275 | } |
276 | } | 276 | } |
277 | 277 | ||
278 | void IRCMessageParser::parseLiteralError(IRCMessage *message) { | 278 | void IRCMessageParser::parseLiteralError(IRCMessage *message) { |
279 | emit outputReady(IRCOutput(OUTPUT_ERROR, message->allParameters())); | 279 | emit outputReady(IRCOutput(OUTPUT_ERROR, message->allParameters())); |
280 | } | 280 | } |
281 | 281 | ||
282 | void IRCMessageParser::parseCTCPPing(IRCMessage *message) { | 282 | void IRCMessageParser::parseCTCPPing(IRCMessage *message) { |
283 | IRCPerson mask(message->prefix()); | 283 | IRCPerson mask(message->prefix()); |
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 | ||
288 | void IRCMessageParser::parseCTCPVersion(IRCMessage *message) { | 322 | void IRCMessageParser::parseCTCPVersion(IRCMessage *message) { |
289 | IRCPerson mask(message->prefix()); | 323 | IRCPerson mask(message->prefix()); |
290 | m_session->m_connection->sendCTCP(mask.nick(), APP_VERSION " " APP_COPYSTR); | 324 | m_session->m_connection->sendCTCP(mask.nick(), APP_VERSION " " APP_COPYSTR); |
291 | emit outputReady(IRCOutput(OUTPUT_CTCP, tr("Received a CTCP VERSION from ")+mask.nick())); | 325 | emit outputReady(IRCOutput(OUTPUT_CTCP, tr("Received a CTCP VERSION from ")+mask.nick())); |
292 | } | 326 | } |
293 | 327 | ||
294 | void IRCMessageParser::parseCTCPAction(IRCMessage *message) { | 328 | void IRCMessageParser::parseCTCPAction(IRCMessage *message) { |
295 | IRCPerson mask(message->prefix()); | 329 | IRCPerson mask(message->prefix()); |
296 | QString dest = message->ctcpDestination(); | 330 | QString dest = message->ctcpDestination(); |
297 | if (dest.startsWith("#")) { | 331 | if (dest.startsWith("#")) { |