X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fcoresessioneventprocessor.cpp;h=1082617c048640b4e27f1cea0b2fa46f650c97e0;hp=59565a08399336f52cf409959559c991ceaccc4f;hb=4ae8f86c1ce452582d6fe576956c7c1bc1460adf;hpb=36ea1791352d34e34b6c6cdef02455a4c43acc17 diff --git a/src/core/coresessioneventprocessor.cpp b/src/core/coresessioneventprocessor.cpp index 59565a08..1082617c 100644 --- a/src/core/coresessioneventprocessor.cpp +++ b/src/core/coresessioneventprocessor.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2010 by the Quassel Project * + * Copyright (C) 2005-2012 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -35,6 +35,7 @@ CoreSessionEventProcessor::CoreSessionEventProcessor(CoreSession *session) _coreSession(session) { connect(coreSession(), SIGNAL(networkDisconnected(NetworkId)), this, SLOT(destroyNetsplits(NetworkId))); + connect(this, SIGNAL(newEvent(Event *)), coreSession()->eventManager(), SLOT(postEvent(Event *))); } bool CoreSessionEventProcessor::checkParamCount(IrcEvent *e, int minParams) { @@ -63,7 +64,7 @@ void CoreSessionEventProcessor::tryNextNick(NetworkEvent *e, const QString &errn MessageEvent *msgEvent = new MessageEvent(Message::Error, e->network(), tr("No free and valid nicks in nicklist found. use: /nick to continue"), QString(), QString(), Message::None, e->timestamp()); - coreSession()->eventManager()->sendEvent(msgEvent); + emit newEvent(msgEvent); return; } else { nextNick = errnick + "_"; @@ -664,6 +665,9 @@ void CoreSessionEventProcessor::processIrcEvent353(IrcEvent *e) { /* ERR_ERRONEUSNICKNAME */ void CoreSessionEventProcessor::processIrcEvent432(IrcEventNumeric *e) { + if(!checkParamCount(e, 1)) + return; + QString errnick; if(e->params().count() < 2) { // handle unreal-ircd bug, where unreal ircd doesnt supply a TARGET in ERR_ERRONEUSNICKNAME during registration phase: @@ -747,12 +751,12 @@ void CoreSessionEventProcessor::handleNetsplitJoin(Network *net, ircChannel->joinIrcUsers(ircUsers, newModes); NetworkSplitEvent *event = new NetworkSplitEvent(EventManager::NetworkSplitJoin, net, channel, newUsers, quitMessage); - coreSession()->eventManager()->sendEvent(event); + emit newEvent(event); } void CoreSessionEventProcessor::handleNetsplitQuit(Network *net, const QString &channel, const QStringList &users, const QString& quitMessage) { NetworkSplitEvent *event = new NetworkSplitEvent(EventManager::NetworkSplitQuit, net, channel, users, quitMessage); - coreSession()->eventManager()->sendEvent(event); + emit newEvent(event); foreach(QString user, users) { IrcUser *iu = net->ircUser(nickFromMask(user)); if(iu) @@ -784,7 +788,7 @@ void CoreSessionEventProcessor::handleEarlyNetsplitJoin(Network *net, const QStr ircChannel->joinIrcUsers(ircUsers, newModes); foreach(NetworkEvent *event, events) { event->setFlag(EventManager::Fake); // ignore this in here! - coreSession()->eventManager()->sendEvent(event); + emit newEvent(event); } }