X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=core%2Fcore.cpp;h=44c925a01c27a8737728f5dac9d23e985692d6d3;hp=f7fedd117ca0004befdeaad62d3b030974d6fa9e;hb=057883f768f86257c9dbefeb5ef12403b207b773;hpb=82403b8a8777d44cbc35619e3bbd4feabfad5dc4 diff --git a/core/core.cpp b/core/core.cpp index f7fedd11..44c925a0 100644 --- a/core/core.cpp +++ b/core/core.cpp @@ -29,9 +29,9 @@ Core::Core() { if(core) qFatal("Trying to instantiate more than one Core object!"); connect(coreProxy, SIGNAL(gsRequestConnect(QStringList)), this, SLOT(connectToIrc(QStringList))); - connect(coreProxy, SIGNAL(gsUserInput(QString)), this, SLOT(inputLine(QString))); - connect(this, SIGNAL(sendMessage(QString, QString, QString)), coreProxy, SLOT(csSendMessage(QString, QString, QString))); - connect(this, SIGNAL(sendStatusMsg(QString, QString)), coreProxy, SLOT(csSendStatusMsg(QString, QString))); + connect(coreProxy, SIGNAL(gsUserInput(QString, QString, QString)), this, SIGNAL(msgFromGUI(QString, QString, QString))); + connect(this, SIGNAL(displayMsg(QString, QString, Message)), coreProxy, SLOT(csDisplayMsg(QString, QString, Message))); + connect(this, SIGNAL(displayStatusMsg(QString, QString)), coreProxy, SLOT(csDisplayStatusMsg(QString, QString))); // Read global settings from config file QSettings s; @@ -54,12 +54,6 @@ void Core::globalDataUpdated(QString key) { s.setValue(QString("Global/")+key, data); } -// temp -void Core::inputLine(QString s) { - emit msgFromGUI("", "", s); - -} - void Core::connectToIrc(QStringList networks) { foreach(QString net, networks) { if(servers.contains(net)) { @@ -69,8 +63,15 @@ void Core::connectToIrc(QStringList networks) { connect(this, SIGNAL(connectToIrc(QString)), server, SLOT(connectToIrc(QString))); connect(this, SIGNAL(disconnectFromIrc(QString)), server, SLOT(disconnectFromIrc(QString))); connect(this, SIGNAL(msgFromGUI(QString, QString, QString)), server, SLOT(userInput(QString, QString, QString))); - connect(server, SIGNAL(sendMessage(QString, QString)), this, SLOT(recvMessageFromServer(QString, QString))); - connect(server, SIGNAL(sendStatusMsg(QString)), this, SLOT(recvStatusMsgFromServer(QString))); + connect(server, SIGNAL(displayMsg(QString, Message)), this, SLOT(recvMessageFromServer(QString, Message))); + connect(server, SIGNAL(displayStatusMsg(QString)), this, SLOT(recvStatusMsgFromServer(QString))); + connect(server, SIGNAL(modeSet(QString, QString, QString)), coreProxy, SLOT(csModeSet(QString, QString, QString))); + connect(server, SIGNAL(topicSet(QString, QString, QString)), coreProxy, SLOT(csTopicSet(QString, QString, QString))); + connect(server, SIGNAL(setNicks(QString, QString, QStringList)), coreProxy, SLOT(csSetNicks(QString, QString, QStringList))); + connect(server, SIGNAL(nickAdded(QString, QString, VarMap)), coreProxy, SLOT(csNickAdded(QString, QString, VarMap))); + connect(server, SIGNAL(nickRemoved(QString, QString)), coreProxy, SLOT(csNickRemoved(QString, QString))); + connect(server, SIGNAL(nickUpdated(QString, QString, VarMap)), coreProxy, SLOT(csNickUpdated(QString, QString, VarMap))); + connect(server, SIGNAL(ownNickSet(QString, QString)), coreProxy, SLOT(csOwnNickSet(QString, QString))); // add error handling server->start(); @@ -80,17 +81,18 @@ void Core::connectToIrc(QStringList networks) { } } -void Core::recvMessageFromServer(QString buf, QString msg) { +// ALL messages coming pass through these functions before going to the GUI. +// So this is the perfect place for storing the backlog and log stuff. +void Core::recvMessageFromServer(QString buf, Message msg) { Q_ASSERT(sender()); QString net = qobject_cast(sender())->getNetwork(); - emit sendMessage(net, buf, msg); + emit displayMsg(net, buf, msg); } void Core::recvStatusMsgFromServer(QString msg) { Q_ASSERT(sender()); QString net = qobject_cast(sender())->getNetwork(); - qDebug() << "sent status:"<