This class processes data from the ircd(via NetworkDataEvent) and is supposed to
generate appropriate specialized events once this skeleton actually has an implementation.
IrcParser will be IrcServerHandler's successor in many respects.
coreuserinputhandler.cpp
coreusersettings.cpp
ctcphandler.cpp
+ ircparser.cpp
ircserverhandler.cpp
netsplit.cpp
postgresqlstorage.cpp
coresessioneventprocessor.h
coreuserinputhandler.h
ctcphandler.h
+ ircparser.h
ircserverhandler.h
netsplit.h
postgresqlstorage.h
#include "corenetwork.h"
+#include "ctcphandler.h"
#include "core.h"
-#include "coresession.h"
#include "coreidentity.h"
#include "corenetworkconfig.h"
-
-#include "ircserverhandler.h"
+#include "coresession.h"
#include "coreuserinputhandler.h"
-#include "ctcphandler.h"
+#include "ircserverhandler.h"
+#include "networkevent.h"
INIT_SYNCABLE_OBJECT(CoreNetwork)
CoreNetwork::CoreNetwork(const NetworkId &networkid, CoreSession *session)
void CoreNetwork::socketHasData() {
while(socket.canReadLine()) {
QByteArray s = socket.readLine().trimmed();
- ircServerHandler()->handleServerMsg(s);
+ ircServerHandler()->handleServerMsg(s); // FIXME remove with events
+
+ coreSession()->eventManager()->sendEvent(new NetworkDataEvent(EventManager::NetworkIncoming, this, s));
}
}
#include "coreusersettings.h"
#include "eventmanager.h"
#include "ircchannel.h"
+#include "ircparser.h"
#include "ircuser.h"
#include "logger.h"
#include "signalproxy.h"
_coreInfo(this),
_eventManager(new EventManager(this)),
_eventProcessor(new CoreSessionEventProcessor(this)),
+ _ircParser(new IrcParser(this)),
scriptEngine(new QScriptEngine(this)),
_processMessages(false),
_ignoreListManager(this)
loadSettings();
initScriptEngine();
- eventManager()->registerObject(eventProcessor(), EventManager::Prepend, "process");
+ eventManager()->registerObject(ircParser(), EventManager::NormalPriority, "process");
+ eventManager()->registerObject(eventProcessor(), EventManager::HighPriority, "process");
// periodically save our session state
connect(&(Core::instance()->syncTimer()), SIGNAL(timeout()), this, SLOT(saveSessionState()));
class CoreNetworkConfig;
class CoreSessionEventProcessor;
class EventManager;
+class IrcParser;
class NetworkConnection;
class SignalProxy;
inline EventManager *eventManager() const { return _eventManager; }
inline CoreSessionEventProcessor *eventProcessor() const { return _eventProcessor; }
+ inline IrcParser *ircParser() const { return _ircParser; }
inline CoreIrcListHelper *ircListHelper() const { return _ircListHelper; }
EventManager *_eventManager;
CoreSessionEventProcessor *_eventProcessor;
+ IrcParser *_ircParser;
QScriptEngine *scriptEngine;
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005-2010 by the Quassel Project *
+ * devel@quassel-irc.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) version 3. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#include "ircparser.h"
+
+#include "coresession.h"
+#include "networkevent.h"
+
+IrcParser::IrcParser(CoreSession *session) :
+ QObject(session),
+ _coreSession(session)
+{
+
+}
+
+void IrcParser::processNetworkIncoming(Event *event) {
+ NetworkDataEvent *e = static_cast<NetworkDataEvent *>(event);
+
+ qDebug() << "received" << e->data();
+}
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005-2010 by the Quassel Project *
+ * devel@quassel-irc.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) version 3. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#ifndef IRCPARSER_H
+#define IRCPARSER_H
+
+#include <QObject>
+
+class CoreSession;
+class Event;
+
+class IrcParser : public QObject {
+ Q_OBJECT
+
+public:
+ IrcParser(CoreSession *session);
+
+ inline CoreSession *coreSession() const { return _coreSession; }
+
+protected:
+ Q_INVOKABLE void processNetworkIncoming(Event *e);
+
+private:
+ CoreSession *_coreSession;
+};
+
+#endif