Make CTCP PING report the correct millisecond round-trip time
[quassel.git] / src / core / eventstringifier.cpp
index 5cb3fd9..c9c35ae 100644 (file)
@@ -733,7 +733,12 @@ void EventStringifier::handleCtcpPing(CtcpEvent *e)
     if (e->ctcpType() == CtcpEvent::Query)
         defaultHandler(e->ctcpCmd(), e);
     else {
+#if QT_VERSION >= 0x040700
         displayMsg(e, Message::Server, tr("Received CTCP-PING answer from %1 with %2 milliseconds round trip time")
-            .arg(nickFromMask(e->prefix())).arg(QDateTime::fromTime_t(e->param().toInt()).msecsTo(e->timestamp())));
+            .arg(nickFromMask(e->prefix())).arg(QDateTime::fromMSecsSinceEpoch(e->param().toULongLong()).msecsTo(e->timestamp())));
+#else
+        displayMsg(e, Message::Server, tr("Received CTCP-PING answer from %1 with %2 seconds round trip time")
+            .arg(nickFromMask(e->prefix())).arg(QDateTime::fromTime_t(e->param().toInt()).secsTo(e->timestamp())));
+#endif
     }
 }