+ // Don't show this in the UI
+ e->setFlag(EventManager::Silent);
+ // TODO: To allow for a user-sent /ping (without arguments, so default timestamp is used),
+ // this could track how many automated PINGs have been sent by the core and subtract one
+ // each time, only marking the PING as silent if there's pending automated pong replies.
+ // However, that's a behavior change which warrants further testing. For now, take the
+ // simpler, previous approach that errs on the side of silencing too much.
+
+ // Calculate latency from time difference, divided by 2 to account for round-trip time
+ e->network()->setLatency(sendTime.msecsTo(QTime::currentTime()) / 2);
+ }
+ else if (coreNetwork(e)->isPongReplyPending() && !coreNetwork(e)->isPongTimestampValid()) {
+ // There's an auto-PING reply pending and we've not yet received a PONG reply with a valid
+ // timestamp. It's possible this server will never respond with a valid timestamp, and thus
+ // any automated PINGs will result in unwanted spamming of the server buffer.
+
+ // Don't show this in the UI
+ e->setFlag(EventManager::Silent);
+ // Remove pending flag
+ coreNetwork(e)->resetPongReplyPending();
+
+ // Log a message
+ qDebug().nospace() << "Received PONG with invalid timestamp from network "
+ << "\"" << qPrintable(e->network()->networkName())
+ << "\" (ID: " << qPrintable(QString::number(e->network()->networkId().toInt()))
+ << "), silencing, parameters are " << e->params();
+ }
+ // else: We're not expecting a PONG reply and timestamp is not valid, assume it's from the user
+}
+
+void CoreSessionEventProcessor::processIrcEventQuit(IrcEvent* e)