Make CTCP PING report the correct millisecond round-trip time
[quassel.git] / src / core / coreuserinputhandler.cpp
index 37a785e..cc508cf 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-2013 by the Quassel Project                        *
+ *   Copyright (C) 2005-2014 by the Quassel Project                        *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
@@ -169,8 +169,11 @@ void CoreUserInputHandler::handleCtcp(const BufferInfo &bufferInfo, const QStrin
     QString verboseMessage = tr("sending CTCP-%1 request to %2").arg(ctcpTag).arg(nick);
 
     if (ctcpTag == "PING") {
-        uint now = QDateTime::currentDateTime().toTime_t();
-        message = QString::number(now);
+#if QT_VERSION >= 0x040700
+        message = QString::number(QDateTime::currentMSecsSinceEpoch());
+#else
+        message = QString::number(QDateTime::currentDateTime().toTime_t());
+#endif
     }
 
     // FIXME make this a proper event