X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fclient%2Fclientauthhandler.cpp;h=34404c992b636d8dcdb21ba610698f5ce8955949;hb=db6e6642a43143bc45ddb0732d144815b68e37f8;hp=2c96a1c9a81ad6da85f9e828644db75d6141b61f;hpb=9ddb5712b16b3219338871d346765bc649007de0;p=quassel.git diff --git a/src/client/clientauthhandler.cpp b/src/client/clientauthhandler.cpp index 2c96a1c9..34404c99 100644 --- a/src/client/clientauthhandler.cpp +++ b/src/client/clientauthhandler.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2016 by the Quassel Project * + * Copyright (C) 2005-2018 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -32,6 +32,7 @@ #include "client.h" #include "clientsettings.h" +#include "logger.h" #include "peerfactory.h" #if QT_VERSION < 0x050000 @@ -42,7 +43,7 @@ using namespace Protocol; ClientAuthHandler::ClientAuthHandler(CoreAccount account, QObject *parent) : AuthHandler(parent), - _peer(0), + _peer(nullptr), _account(account), _probing(false), _legacy(false), @@ -52,6 +53,12 @@ ClientAuthHandler::ClientAuthHandler(CoreAccount account, QObject *parent) } +Peer *ClientAuthHandler::peer() const +{ + return _peer; +} + + void ClientAuthHandler::connectToCore() { CoreAccountSettings s; @@ -299,7 +306,7 @@ void ClientAuthHandler::startRegistration() useSsl = _account.useSsl(); #endif - _peer->dispatch(RegisterClient(Quassel::buildInfo().fancyVersionString, Quassel::buildInfo().commitDate, useSsl, Quassel::features())); + _peer->dispatch(RegisterClient(Quassel::Features{}, Quassel::buildInfo().fancyVersionString, Quassel::buildInfo().commitDate, useSsl)); } @@ -316,8 +323,7 @@ void ClientAuthHandler::handle(const ClientRegistered &msg) _backendInfo = msg.backendInfo; _authenticatorInfo = msg.authenticatorInfo; - Client::setCoreFeatures(Quassel::Features(msg.coreFeatures)); - SignalProxy::current()->sourcePeer()->setFeatures(Quassel::Features(msg.coreFeatures)); + _peer->setFeatures(std::move(msg.features)); // The legacy protocol enables SSL at this point if(_legacy && _account.useSsl()) @@ -329,6 +335,15 @@ void ClientAuthHandler::handle(const ClientRegistered &msg) void ClientAuthHandler::onConnectionReady() { + const auto &coreFeatures = _peer->features(); + auto unsupported = coreFeatures.toStringList(false); + if (!unsupported.isEmpty()) { + quInfo() << qPrintable(tr("Core does not support the following features: %1").arg(unsupported.join(", "))); + } + if (!coreFeatures.unknownFeatures().isEmpty()) { + quInfo() << qPrintable(tr("Core supports unknown features: %1").arg(coreFeatures.unknownFeatures().join(", "))); + } + emit connectionReady(); emit statusMessage(tr("Connected to %1").arg(_account.accountName()));