/***************************************************************************
- * 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 *
***************************************************************************/
#include <QtEndian>
-
+#include <QDataStream>
#include <QHostAddress>
#include <QTcpSocket>
#include "datastreampeer.h"
-#include "quassel.h"
using namespace Protocol;
-DataStreamPeer::DataStreamPeer(::AuthHandler *authHandler, QTcpSocket *socket, quint16 features, QObject *parent)
- : RemotePeer(authHandler, socket, parent)
+DataStreamPeer::DataStreamPeer(::AuthHandler *authHandler, QTcpSocket *socket, quint16 features, Compressor::CompressionLevel level, QObject *parent)
+ : RemotePeer(authHandler, socket, level, parent)
{
Q_UNUSED(features);
}
}
if (msgType == "ClientInit") {
- handle(RegisterClient(m["ClientVersion"].toString(), false)); // UseSsl obsolete
+ handle(RegisterClient(m["ClientVersion"].toString(), m["ClientDate"].toString(), false)); // UseSsl obsolete
}
else if (msgType == "ClientInitReject") {
}
else if (msgType == "ClientInitAck") {
- handle(ClientRegistered(m["CoreFeatures"].toUInt(), m["Configured"].toBool(), m["StorageBackends"].toList(), false, QDateTime())); // SupportsSsl and coreStartTime obsolete
+ handle(ClientRegistered(m["CoreFeatures"].toUInt(), m["Configured"].toBool(), m["StorageBackends"].toList(), m["AuthBackends"].toList(), false)); // SupportsSsl is obsolete
}
else if (msgType == "CoreSetupData") {
QVariantMap map = m["SetupData"].toMap();
- handle(SetupData(map["AdminUser"].toString(), map["AdminPasswd"].toString(), map["Backend"].toString(), map["ConnectionProperties"].toMap()));
+ handle(SetupData(map["AdminUser"].toString(), map["AdminPasswd"].toString(), map["Backend"].toString(), map["AuthBackend"].toString(), map["ConnectionProperties"].toMap(), map["AuthProperties"].toMap()));
}
else if (msgType == "CoreSetupReject") {
QVariantMap m;
m["MsgType"] = "ClientInit";
m["ClientVersion"] = msg.clientVersion;
- m["ClientDate"] = Quassel::buildInfo().buildDate;
+ m["ClientDate"] = msg.buildDate;
writeMessage(m);
}
m["MsgType"] = "ClientInitAck";
m["CoreFeatures"] = msg.coreFeatures;
m["StorageBackends"] = msg.backendInfo;
+ m["AuthBackends"] = msg.authBackendInfo;
m["LoginEnabled"] = m["Configured"] = msg.coreConfigured;
writeMessage(m);
map["Backend"] = msg.backend;
map["ConnectionProperties"] = msg.setupData;
+ // Auth backend properties.
+ // XXX: make these optional using core features.
+ map["AuthBackend"] = msg.authenticator;
+ map["AuthProperties"] = msg.authSetupData;
+
QVariantMap m;
m["MsgType"] = "CoreSetupData";
m["SetupData"] = map;