X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcore%2Fircparser.cpp;h=ccd395056e8eb89d2f0ec524c61701688ca9890e;hb=95f6cd0e720266733858d56b295548418cb86039;hp=d5f5295431a509763ed8650a2548b0592afb8d23;hpb=e38846f054ad1766f2e91992a57bbaffd33c7c06;p=quassel.git diff --git a/src/core/ircparser.cpp b/src/core/ircparser.cpp index d5f52954..ccd39505 100644 --- a/src/core/ircparser.cpp +++ b/src/core/ircparser.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2019 by the Quassel Project * + * Copyright (C) 2005-2020 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -119,14 +119,13 @@ void IrcParser::processNetworkIncoming(NetworkDataEvent* e) qDebug() << "IRC net" << net->networkId() << "<<" << tags << prefix << cmd << params; } - IrcTagKey serverTimeTag{"", "time", false}; - if (tags.contains(serverTimeTag)) { - QDateTime serverTime = QDateTime::fromString(tags[serverTimeTag], "yyyy-MM-ddThh:mm:ss.zzzZ"); + if (net->capEnabled(IrcCap::SERVER_TIME) && tags.contains(IrcTags::SERVER_TIME)) { + QDateTime serverTime = QDateTime::fromString(tags[IrcTags::SERVER_TIME], "yyyy-MM-ddThh:mm:ss.zzzZ"); serverTime.setTimeSpec(Qt::UTC); if (serverTime.isValid()) { e->setTimestamp(serverTime); } else { - qDebug() << "Invalid timestamp from server-time tag:" << tags[serverTimeTag]; + qDebug() << "Invalid timestamp from server-time tag:" << tags[IrcTags::SERVER_TIME]; } }