X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fircparser.cpp;h=605dd2e81d876e1f037cd1b6acc3302dbb1592ff;hp=b372e35106d935f40580b7b6e34a1b527946d4a6;hb=88b350153eb364853e75d237d3eed2dfaf839d59;hpb=393ac8b4bca9db98f297cb4756ef2e79364bf6f0 diff --git a/src/core/ircparser.cpp b/src/core/ircparser.cpp index b372e351..605dd2e8 100644 --- a/src/core/ircparser.cpp +++ b/src/core/ircparser.cpp @@ -34,7 +34,7 @@ IrcParser::IrcParser(CoreSession *session) : QObject(session), _coreSession(session) { - + connect(this, SIGNAL(newEvent(Event *)), coreSession()->eventManager(), SLOT(postEvent(Event *))); } bool IrcParser::checkParamCount(const QString &cmd, const QList ¶ms, int minParams) { @@ -136,16 +136,18 @@ void IrcParser::processNetworkIncoming(NetworkDataEvent *e) { QList events; EventManager::EventType type = EventManager::Invalid; - // numeric replies have the target as first param (RFC 2812 - 2.4). this is usually our own nick. Remove this! uint num = cmd.toUInt(); if(num > 0) { + // numeric reply if(params.count() == 0) { qWarning() << "Message received from server violates RFC and is ignored!" << msg; return; } + // numeric replies have the target as first param (RFC 2812 - 2.4). this is usually our own nick. Remove this! target = net->serverDecode(params.takeFirst()); type = EventManager::IrcEventNumeric; } else { + // any other irc command QString typeName = QLatin1String("IrcEvent") + cmd.at(0).toUpper() + cmd.mid(1).toLower(); type = eventManager()->eventTypeByName(typeName); if(type == EventManager::Invalid) { @@ -300,6 +302,6 @@ void IrcParser::processNetworkIncoming(NetworkDataEvent *e) { } foreach(Event *event, events) { - coreSession()->eventManager()->sendEvent(event); + emit newEvent(event); } }