X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fprotocol.h;h=499d36e3f5747f8189bea8021db29727c8d176e3;hp=4576080168825e35933ae3c4ff2d55b0e4ffb8e7;hb=0dbec2cfc937857d66a9645249f876f1e6b3f05e;hpb=53861faa5551606eea31588b65ba501b24fb2e1a diff --git a/src/common/protocol.h b/src/common/protocol.h index 45760801..499d36e3 100644 --- a/src/common/protocol.h +++ b/src/common/protocol.h @@ -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 * @@ -18,13 +18,14 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef PROTOCOL_H_ -#define PROTOCOL_H_ +#pragma once #include #include #include +#include "quassel.h" + namespace Protocol { const quint32 magic = 0x42b33f00; @@ -57,18 +58,19 @@ struct HandshakeMessage { struct RegisterClient : public HandshakeMessage { - inline RegisterClient(const QString &clientVersion, const QString &buildDate, bool sslSupported = false, int32_t features = 0) - : clientVersion(clientVersion) - , buildDate(buildDate) - , sslSupported(sslSupported) - , clientFeatures(features) {} + inline RegisterClient(Quassel::Features clientFeatures, const QString &clientVersion, const QString &buildDate, bool sslSupported = false) + : features(std::move(clientFeatures)) + , clientVersion(clientVersion) + , buildDate(buildDate) + , sslSupported(sslSupported) + {} + Quassel::Features features; QString clientVersion; QString buildDate; // this is only used by the LegacyProtocol in compat mode bool sslSupported; - int32_t clientFeatures; }; @@ -83,19 +85,19 @@ struct ClientDenied : public HandshakeMessage struct ClientRegistered : public HandshakeMessage { - inline ClientRegistered(quint32 coreFeatures, bool coreConfigured, const QVariantList &backendInfo, bool sslSupported, const QVariantList &authenticatorInfo) - : coreFeatures(coreFeatures) - , coreConfigured(coreConfigured) - , backendInfo(backendInfo) - , authenticatorInfo(authenticatorInfo) - , sslSupported(sslSupported) + inline ClientRegistered(Quassel::Features coreFeatures, bool coreConfigured, const QVariantList &backendInfo, const QVariantList &authenticatorInfo, bool sslSupported) + : features(std::move(coreFeatures)) + , coreConfigured(coreConfigured) + , backendInfo(backendInfo) + , authenticatorInfo(authenticatorInfo) + , sslSupported(sslSupported) {} - quint32 coreFeatures; + Quassel::Features features; bool coreConfigured; + QVariantList backendInfo; // TODO: abstract this better // The authenticatorInfo should be optional! - QVariantList backendInfo; // TODO: abstract this better QVariantList authenticatorInfo; // this is only used by the LegacyProtocol in compat mode @@ -247,5 +249,3 @@ struct HeartBeatReply }; - -#endif