#include <QTcpSocket>
#include "legacypeer.h"
+#include "quassel.h"
/* version.inc is no longer used for this */
const uint protocolVersion = 10;
socket()->setProperty("UseCompression", true);
}
#endif
- handle(RegisterClient(m["ClientVersion"].toString(), m["ClientDate"].toString(), m["UseSsl"].toBool(), m["Features"].toInt()));
+ handle(RegisterClient{Quassel::Features{m["FeatureList"].toStringList(), Quassel::LegacyFeatures(m["Features"].toUInt())},
+ m["ClientVersion"].toString(),
+ m["ClientDate"].toString(),
+ m["UseSsl"].toBool()});
}
else if (msgType == "ClientInitReject") {
socket()->setProperty("UseCompression", true);
#endif
- handle(ClientRegistered(m["CoreFeatures"].toUInt(), m["Configured"].toBool(), m["StorageBackends"].toList(), m["SupportSsl"].toBool(), m["Authenticators"].toList()));
+ handle(ClientRegistered{Quassel::Features{m["FeatureList"].toStringList(), Quassel::LegacyFeatures(m["CoreFeatures"].toUInt())},
+ m["Configured"].toBool(),
+ m["StorageBackends"].toList(),
+ m["Authenticators"].toList(),
+ m["SupportSsl"].toBool()});
}
else if (msgType == "CoreSetupData") {
void LegacyPeer::dispatch(const RegisterClient &msg) {
QVariantMap m;
m["MsgType"] = "ClientInit";
+ m["Features"] = static_cast<quint32>(msg.features.toLegacyFeatures());
+ m["FeatureList"] = msg.features.toStringList();
m["ClientVersion"] = msg.clientVersion;
m["ClientDate"] = msg.buildDate;
- m["Features"] = msg.clientFeatures;
// FIXME only in compat mode
m["ProtocolVersion"] = protocolVersion;
void LegacyPeer::dispatch(const ClientRegistered &msg) {
QVariantMap m;
m["MsgType"] = "ClientInitAck";
- m["CoreFeatures"] = msg.coreFeatures;
+ if (hasFeature(Quassel::Feature::ExtendedFeatures)) {
+ m["FeatureList"] = msg.features.toStringList();
+ }
+ else {
+ m["CoreFeatures"] = static_cast<quint32>(msg.features.toLegacyFeatures());
+ }
m["StorageBackends"] = msg.backendInfo;
- m["Authenticators"] = msg.authenticatorInfo;
+ if (hasFeature(Quassel::Feature::Authenticators)) {
+ m["Authenticators"] = msg.authenticatorInfo;
+ }
// FIXME only in compat mode
m["ProtocolVersion"] = protocolVersion;