This means that legacypeer.h needs be included by peerfactory.cpp only,
and we can remove all references to it elsewhere.
#include "clientsettings.h"
#include "peerfactory.h"
#include "clientsettings.h"
#include "peerfactory.h"
-#include "protocols/legacy/legacypeer.h"
-
using namespace Protocol;
ClientAuthHandler::ClientAuthHandler(CoreAccount account, QObject *parent)
using namespace Protocol;
ClientAuthHandler::ClientAuthHandler(CoreAccount account, QObject *parent)
qDebug() << "Legacy core detected, switching to compatibility mode";
qDebug() << "Legacy core detected, switching to compatibility mode";
- RemotePeer *peer = new LegacyPeer(this, socket(), this);
+ RemotePeer *peer = PeerFactory::createPeer(PeerFactory::ProtoDescriptor(Protocol::LegacyProtocol, 0), this, socket(), this);
// Only needed for the legacy peer, as all others check the protocol version before instantiation
connect(peer, SIGNAL(protocolVersionMismatch(int,int)), SLOT(onProtocolVersionMismatch(int,int)));
// Only needed for the legacy peer, as all others check the protocol version before instantiation
connect(peer, SIGNAL(protocolVersionMismatch(int,int)), SLOT(onProtocolVersionMismatch(int,int)));
#include "sqlitestorage.h"
#include "util.h"
#include "sqlitestorage.h"
#include "util.h"
-#include "protocols/legacy/legacypeer.h"
-
// migration related
#include <QFile>
#ifdef Q_OS_WIN32
// migration related
#include <QFile>
#ifdef Q_OS_WIN32
#include "core.h"
#include "logger.h"
#include "core.h"
#include "logger.h"
-#include "protocols/legacy/legacypeer.h"
-
using namespace Protocol;
CoreAuthHandler::CoreAuthHandler(QTcpSocket *socket, QObject *parent)
using namespace Protocol;
CoreAuthHandler::CoreAuthHandler(QTcpSocket *socket, QObject *parent)
// no magic, assume legacy protocol
qDebug() << "Legacy client detected, switching to compatibility mode";
_legacy = true;
// no magic, assume legacy protocol
qDebug() << "Legacy client detected, switching to compatibility mode";
_legacy = true;
- RemotePeer *peer = new LegacyPeer(this, socket(), this);
+ RemotePeer *peer = PeerFactory::createPeer(PeerFactory::ProtoDescriptor(Protocol::LegacyProtocol, 0), this, socket(), this);
connect(peer, SIGNAL(protocolVersionMismatch(int,int)), SLOT(onProtocolVersionMismatch(int,int)));
setPeer(peer);
return;
connect(peer, SIGNAL(protocolVersionMismatch(int,int)), SLOT(onProtocolVersionMismatch(int,int)));
setPeer(peer);
return;
#include "ircuser.h"
#include "logger.h"
#include "messageevent.h"
#include "ircuser.h"
#include "logger.h"
#include "messageevent.h"
#include "storage.h"
#include "util.h"
#include "storage.h"
#include "util.h"
-#include "protocols/legacy/legacypeer.h"
class ProcessMessagesEvent : public QEvent
{
class ProcessMessagesEvent : public QEvent
{