X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fprotocols%2Flegacy%2Flegacypeer.cpp;h=9ceb4607ee831cc68241efdaf6376636859e4431;hp=67e513003e968849ba5bf240431667adff12a00c;hb=3856cfd6126cdea97c91a22be7ded92ccc0a3577;hpb=ce26c3770b254362c7bd1e094ba8f8bf22133653 diff --git a/src/common/protocols/legacy/legacypeer.cpp b/src/common/protocols/legacy/legacypeer.cpp index 67e51300..9ceb4607 100644 --- a/src/common/protocols/legacy/legacypeer.cpp +++ b/src/common/protocols/legacy/legacypeer.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2014 by the Quassel Project * + * Copyright (C) 2005-2016 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -19,10 +19,10 @@ ***************************************************************************/ #include +#include #include #include "legacypeer.h" -#include "quassel.h" /* version.inc is no longer used for this */ const uint protocolVersion = 10; @@ -151,7 +151,7 @@ void LegacyPeer::handleHandshakeMessage(const QVariant &msg) socket()->setProperty("UseCompression", true); } #endif - handle(RegisterClient(m["ClientVersion"].toString(), m["UseSsl"].toBool())); + handle(RegisterClient(m["ClientVersion"].toString(), m["ClientDate"].toString(), m["UseSsl"].toBool())); } else if (msgType == "ClientInitReject") { @@ -170,7 +170,7 @@ void LegacyPeer::handleHandshakeMessage(const QVariant &msg) socket()->setProperty("UseCompression", true); #endif - handle(ClientRegistered(m["CoreFeatures"].toUInt(), m["Configured"].toBool(), m["StorageBackends"].toList(), m["SupportSsl"].toBool(), QDateTime())); + handle(ClientRegistered(m["CoreFeatures"].toUInt(), m["Configured"].toBool(), m["StorageBackends"].toList(), m["SupportSsl"].toBool())); } else if (msgType == "CoreSetupData") { @@ -213,7 +213,7 @@ void LegacyPeer::dispatch(const RegisterClient &msg) { QVariantMap m; m["MsgType"] = "ClientInit"; m["ClientVersion"] = msg.clientVersion; - m["ClientDate"] = Quassel::buildInfo().buildDate; + m["ClientDate"] = msg.buildDate; // FIXME only in compat mode m["ProtocolVersion"] = protocolVersion; @@ -248,16 +248,8 @@ void LegacyPeer::dispatch(const ClientRegistered &msg) { m["SupportSsl"] = msg.sslSupported; m["SupportsCompression"] = socket()->property("UseCompression").toBool(); // this property gets already set in the ClientInit handler - // This is only used for old v10 clients (pre-0.5) - int uptime = msg.coreStartTime.secsTo(QDateTime::currentDateTime().toUTC()); - int updays = uptime / 86400; uptime %= 86400; - int uphours = uptime / 3600; uptime %= 3600; - int upmins = uptime / 60; - m["CoreInfo"] = tr("Quassel Core Version %1
" - "Built: %2
" - "Up %3d%4h%5m (since %6)").arg(Quassel::buildInfo().fancyVersionString) - .arg(Quassel::buildInfo().buildDate) - .arg(updays).arg(uphours, 2, 10, QChar('0')).arg(upmins, 2, 10, QChar('0')).arg(msg.coreStartTime.toString(Qt::TextDate)); + // This is only used for display by really old v10 clients (pre-0.5), and we no longer set this + m["CoreInfo"] = QString(); m["LoginEnabled"] = m["Configured"] = msg.coreConfigured;