X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcore%2Feventstringifier.cpp;h=15e246f38ec457427238272c6741f98f6dd0ba97;hb=bd5414d8bfe2be18ba051d4bbf936e9ead0cdf66;hp=c1279ffe3f0d00d9c355259ee6cf4bb9fc9416cf;hpb=6a63070246d89aa2a2474e3a9a1035fa889ad77e;p=quassel.git diff --git a/src/core/eventstringifier.cpp b/src/core/eventstringifier.cpp index c1279ffe..15e246f3 100644 --- a/src/core/eventstringifier.cpp +++ b/src/core/eventstringifier.cpp @@ -449,15 +449,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)