core: Remove leftover getAuthUserName and SQL
[quassel.git] / src / core / eventstringifier.cpp
index c1279ff..c7da8d7 100644 (file)
@@ -365,10 +365,11 @@ void EventStringifier::processIrcEventPart(IrcEvent *e)
 
 void EventStringifier::processIrcEventPong(IrcEvent *e)
 {
-    QString timestamp = e->params().at(1);
-    QTime sendTime = QTime::fromString(timestamp, "hh:mm:ss.zzz");
-    if (!sendTime.isValid())
-        displayMsg(e, Message::Server, "PONG " + e->params().join(" "), e->prefix());
+    // CoreSessionEventProcessor will flag automated PONG replies as EventManager::Silent.  There's
+    // no need to handle that specially here.
+
+    // Format the PONG reply for display
+    displayMsg(e, Message::Server, "PONG " + e->params().join(" "), e->prefix());
 }
 
 
@@ -449,15 +450,13 @@ void EventStringifier::processIrcEvent301(IrcEvent *e)
         target = nick;
         IrcUser *ircuser = e->network()->ircUser(nick);
         if (ircuser) {
-            // FIXME: This needs converted to 64-bit time.
-            // For legacy protocol, keep the 32-bit signed int time.  For modern protocol, just send
-            // the actual QDateTime() instead, don't bother converting it.
-            int now = QDateTime::currentDateTime().toTime_t();
-            // FIXME: Convert to millisecond comparison, comment the constant value as needed
+            QDateTime now = QDateTime::currentDateTime();
+            now.setTimeSpec(Qt::UTC);
+            // Don't print "user is away" messages more often than this
             const int silenceTime = 60;
-            if (ircuser->lastAwayMessage() + silenceTime >= now)
+            if (ircuser->lastAwayMessageTime().addSecs(silenceTime) >= now)
                 send = false;
-            ircuser->setLastAwayMessage(now);
+            ircuser->setLastAwayMessageTime(now);
         }
     }
     if (send)