X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=core%2Fcoreproxy.cpp;h=11fdf95bc99630a8a4cdf9db532a5f74c390721b;hp=913804700ebcf5a5978103877eb58355db3cb23d;hb=d6a96a47a3964b9c0b1ea2413601d70d0d327413;hpb=959e81d7ff35673870505331c012107cf67a5ab9 diff --git a/core/coreproxy.cpp b/core/coreproxy.cpp index 91380470..11fdf95b 100644 --- a/core/coreproxy.cpp +++ b/core/coreproxy.cpp @@ -23,9 +23,12 @@ #include "coreproxy.h" #include "global.h" #include "util.h" +#include "core.h" CoreProxy::CoreProxy() { if(coreProxy) qFatal("Trying to instantiate more than one CoreProxy object!"); + coreProxy = this; + core = new Core(); connect(global, SIGNAL(dataPutLocally(QString)), this, SLOT(updateGlobalData(QString))); connect(&server, SIGNAL(newConnection()), this, SLOT(incomingConnection())); @@ -85,11 +88,19 @@ void CoreProxy::processClientInit(QTcpSocket *socket, const QVariant &v) { coreData[key] = global->getData(key); } reply["CoreData"] = coreData; - //QVariant payload = QByteArray(1000000, 'a'); - //reply["payload"] = payload; + VarMap bl; + QHash > log = core->getBackLog(); + foreach(QString net, log.keys()) { + QByteArray buf; + QDataStream out(&buf, QIODevice::WriteOnly); out.setVersion(QDataStream::Qt_4_2); + foreach(Message msg, log[net]) { out << msg; } + bl[net] = buf; + } + reply["CoreBackLog"] = bl; QList sigdata; sigdata.append(CS_CORE_STATE); sigdata.append(QVariant(reply)); sigdata.append(QVariant()); sigdata.append(QVariant()); writeDataToDevice(socket, QVariant(sigdata)); + emit requestServerStates(); } void CoreProxy::processClientUpdate(QTcpSocket *socket, QString key, QVariant data) {