X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fircserverhandler.cpp;fp=src%2Fcore%2Fircserverhandler.cpp;h=2e15fc9d3ae8083b3a3e47548a4f8231bc146d28;hp=84c6a194796f216d65aeaf6e515d3f1af509986b;hb=ffeac2cd096c19e59fddf559488c67e012efd343;hpb=2d7fa70ddeddb4efdd1c2514a855cf9a6eef39bb diff --git a/src/core/ircserverhandler.cpp b/src/core/ircserverhandler.cpp index 84c6a194..2e15fc9d 100644 --- a/src/core/ircserverhandler.cpp +++ b/src/core/ircserverhandler.cpp @@ -873,10 +873,12 @@ void IrcServerHandler::handle317(const QString &prefix, const QList QString nick = serverDecode(params[0]); IrcUser *ircuser = network()->ircUser(nick); + + QDateTime now = QDateTime::currentDateTime(); + int idleSecs = serverDecode(params[1]).toInt(); + idleSecs *= -1; + if(ircuser) { - QDateTime now = QDateTime::currentDateTime(); - int idleSecs = serverDecode(params[1]).toInt(); - idleSecs *= -1; ircuser->setIdleTime(now.addSecs(idleSecs)); if(params.size() > 3) { // if we have more then 3 params we have the above mentioned "real life" situation int loginTime = serverDecode(params[2]).toInt(); @@ -884,11 +886,7 @@ void IrcServerHandler::handle317(const QString &prefix, const QList emit displayMsg(Message::Server, BufferInfo::StatusBuffer, "", tr("[Whois] %1 is logged in since %2").arg(ircuser->nick()).arg(ircuser->loginTime().toString())); } emit displayMsg(Message::Server, BufferInfo::StatusBuffer, "", tr("[Whois] %1 is idling for %2 (%3)").arg(ircuser->nick()).arg(secondsToString(ircuser->idleTime().secsTo(now))).arg(ircuser->idleTime().toString())); - } else { - QDateTime now = QDateTime::currentDateTime(); - int idleSecs = serverDecode(params[1]).toInt(); - idleSecs *= -1; QDateTime idleSince = now.addSecs(idleSecs); if (params.size() > 3) { // we have a signon time int loginTime = serverDecode(params[2]).toInt();