1 /***************************************************************************
2 * Copyright (C) 2005-2010 by the Quassel Project *
3 * devel@quassel-irc.org *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) version 3. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
21 #include "coresessioneventprocessor.h"
23 #include "coreirclisthelper.h"
24 #include "corenetwork.h"
25 #include "coresession.h"
28 #include "messageevent.h"
31 CoreSessionEventProcessor::CoreSessionEventProcessor(CoreSession *session)
35 connect(coreSession(), SIGNAL(networkDisconnected(NetworkId)), this, SLOT(destroyNetsplits(NetworkId)));
38 bool CoreSessionEventProcessor::checkParamCount(IrcEvent *e, int minParams) {
39 if(e->params().count() < minParams) {
40 if(e->type() == EventManager::IrcEventNumeric) {
41 qWarning() << "Command " << static_cast<IrcEventNumeric *>(e)->number() << " requires " << minParams << "params, got: " << e->params();
43 QString name = coreSession()->eventManager()->enumName(e->type());
44 qWarning() << qPrintable(name) << "requires" << minParams << "params, got:" << e->params();
52 void CoreSessionEventProcessor::tryNextNick(NetworkEvent *e, const QString &errnick, bool erroneus) {
53 QStringList desiredNicks = coreSession()->identity(e->network()->identity())->nicks();
54 int nextNickIdx = desiredNicks.indexOf(errnick) + 1;
56 if(nextNickIdx > 0 && desiredNicks.size() > nextNickIdx) {
57 nextNick = desiredNicks[nextNickIdx];
60 // FIXME Make this an ErrorEvent or something like that, so it's translated in the client
61 MessageEvent *msgEvent = new MessageEvent(Message::Error, e->network(),
62 tr("No free and valid nicks in nicklist found. use: /nick <othernick> to continue"),
63 QString(), QString(), Message::None, e->timestamp());
64 coreSession()->eventManager()->sendEvent(msgEvent);
67 nextNick = errnick + "_";
70 // FIXME Use a proper output event for this
71 coreNetwork(e)->putRawLine("NICK " + coreNetwork(e)->encodeServerString(nextNick));
74 void CoreSessionEventProcessor::processIrcEventNumeric(IrcEventNumeric *e) {
78 case 903: case 904: case 905: case 906: case 907:
79 qobject_cast<CoreNetwork *>(e->network())->putRawLine("CAP END");
87 void CoreSessionEventProcessor::processIrcEventAuthenticate(IrcEvent *e) {
88 if(!checkParamCount(e, 1))
91 if(e->params().at(0) != "+") {
92 qWarning() << "Invalid AUTHENTICATE" << e;
96 CoreNetwork *net = coreNetwork(e);
98 QString construct = net->saslAccount();
99 construct.append(QChar(QChar::Null));
100 construct.append(net->saslAccount());
101 construct.append(QChar(QChar::Null));
102 construct.append(net->saslPassword());
103 QByteArray saslData = QByteArray(construct.toAscii().toBase64());
104 saslData.prepend("AUTHENTICATE ");
105 net->putRawLine(saslData);
108 void CoreSessionEventProcessor::processIrcEventCap(IrcEvent *e) {
109 // for SASL, there will only be a single param of 'sasl', however you can check here for
110 // additional CAP messages (ls, multi-prefix, et cetera).
112 if(e->params().count() == 3) {
113 if(e->params().at(2) == "sasl") {
115 coreNetwork(e)->putRawLine(coreNetwork(e)->serverEncode("AUTHENTICATE PLAIN")); // Only working with PLAIN atm, blowfish later
120 void CoreSessionEventProcessor::processIrcEventInvite(IrcEvent *e) {
121 if(checkParamCount(e, 2)) {
122 e->network()->updateNickFromMask(e->prefix());
126 void CoreSessionEventProcessor::processIrcEventJoin(IrcEvent *e) {
127 if(e->testFlag(EventManager::Fake)) // generated by handleEarlyNetsplitJoin
130 if(!checkParamCount(e, 1))
133 CoreNetwork *net = coreNetwork(e);
134 QString channel = e->params()[0];
135 IrcUser *ircuser = net->updateNickFromMask(e->prefix());
137 bool handledByNetsplit = false;
138 foreach(Netsplit* n, _netsplits.value(e->network())) {
139 handledByNetsplit = n->userJoined(e->prefix(), channel);
140 if(handledByNetsplit)
144 if(!handledByNetsplit)
145 ircuser->joinChannel(channel);
147 e->setFlag(EventManager::Netsplit);
149 if(net->isMe(ircuser)) {
150 net->setChannelJoined(channel);
152 net->putRawLine(net->serverEncode("MODE " + channel)); // we want to know the modes of the channel we just joined, so we ask politely
156 void CoreSessionEventProcessor::processIrcEventKick(IrcEvent *e) {
157 if(checkParamCount(e, 2)) {
158 e->network()->updateNickFromMask(e->prefix());
159 IrcUser *victim = e->network()->ircUser(e->params().at(1));
161 victim->partChannel(e->params().at(0));
162 //if(e->network()->isMe(victim)) e->network()->setKickedFromChannel(channel);
167 void CoreSessionEventProcessor::processIrcEventMode(IrcEvent *e) {
168 if(!checkParamCount(e, 2))
171 if(e->network()->isChannelName(e->params().first())) {
174 IrcChannel *channel = e->network()->ircChannel(e->params()[0]);
176 // we received mode information for a channel we're not in. that means probably we've just been kicked out or something like that
177 // anyways: we don't have a place to store the data --> discard the info.
181 QString modes = e->params()[1];
184 for(int c = 0; c < modes.length(); c++) {
185 if(modes[c] == '+') {
189 if(modes[c] == '-') {
194 if(e->network()->prefixModes().contains(modes[c])) {
195 // user channel modes (op, voice, etc...)
196 if(paramOffset < e->params().count()) {
197 IrcUser *ircUser = e->network()->ircUser(e->params()[paramOffset]);
199 qWarning() << Q_FUNC_INFO << "Unknown IrcUser:" << e->params()[paramOffset];
202 bool handledByNetsplit = false;
203 QHash<QString, Netsplit *> splits = _netsplits.value(e->network());
204 foreach(Netsplit* n, _netsplits.value(e->network())) {
205 handledByNetsplit = n->userAlreadyJoined(ircUser->hostmask(), channel->name());
206 if(handledByNetsplit) {
207 n->addMode(ircUser->hostmask(), channel->name(), QString(modes[c]));
211 if(!handledByNetsplit)
212 channel->addUserMode(ircUser, QString(modes[c]));
215 channel->removeUserMode(ircUser, QString(modes[c]));
218 qWarning() << "Received MODE with too few parameters:" << e->params();
222 // regular channel modes
224 Network::ChannelModeType modeType = e->network()->channelModeType(modes[c]);
225 if(modeType == Network::A_CHANMODE || modeType == Network::B_CHANMODE || (modeType == Network::C_CHANMODE && add)) {
226 if(paramOffset < e->params().count()) {
227 value = e->params()[paramOffset];
229 qWarning() << "Received MODE with too few parameters:" << e->params();
235 channel->addChannelMode(modes[c], value);
237 channel->removeChannelMode(modes[c], value);
243 IrcUser *ircUser = e->network()->newIrcUser(e->params().first());
244 QString modeString(e->params()[1]);
248 for(int c = 0; c < modeString.count(); c++) {
249 if(modeString[c] == '+') {
253 if(modeString[c] == '-') {
258 addModes += modeString[c];
260 removeModes += modeString[c];
262 if(!addModes.isEmpty())
263 ircUser->addUserModes(addModes);
264 if(!removeModes.isEmpty())
265 ircUser->removeUserModes(removeModes);
267 if(e->network()->isMe(ircUser)) {
268 coreNetwork(e)->updatePersistentModes(addModes, removeModes);
273 void CoreSessionEventProcessor::processIrcEventNick(IrcEvent *e) {
274 if(checkParamCount(e, 1)) {
275 IrcUser *ircuser = e->network()->updateNickFromMask(e->prefix());
277 qWarning() << Q_FUNC_INFO << "Unknown IrcUser!";
280 QString newnick = e->params().at(0);
281 QString oldnick = ircuser->nick();
283 // the order is cruicial
284 // otherwise the client would rename the buffer, see that the assigned ircuser doesn't match anymore
285 // and remove the ircuser from the querybuffer leading to a wrong on/offline state
286 ircuser->setNick(newnick);
287 coreSession()->renameBuffer(e->networkId(), newnick, oldnick);
291 void CoreSessionEventProcessor::processIrcEventPart(IrcEvent *e) {
292 if(checkParamCount(e, 1)) {
293 IrcUser *ircuser = e->network()->updateNickFromMask(e->prefix());
295 qWarning() << Q_FUNC_INFO<< "Unknown IrcUser!";
298 QString channel = e->params().at(0);
299 ircuser->partChannel(channel);
300 if(e->network()->isMe(ircuser))
301 qobject_cast<CoreNetwork *>(e->network())->setChannelParted(channel);
305 void CoreSessionEventProcessor::processIrcEventPong(IrcEvent *e) {
306 // the server is supposed to send back what we passed as param. and we send a timestamp
307 // but using quote and whatnought one can send arbitrary pings, so we have to do some sanity checks
308 if(checkParamCount(e, 2)) {
309 QString timestamp = e->params().at(1);
310 QTime sendTime = QTime::fromString(timestamp, "hh:mm:ss.zzz");
311 if(sendTime.isValid())
312 e->network()->setLatency(sendTime.msecsTo(QTime::currentTime()) / 2);
316 void CoreSessionEventProcessor::processIrcEventQuit(IrcEvent *e) {
317 IrcUser *ircuser = e->network()->updateNickFromMask(e->prefix());
322 if(e->params().count() > 0)
323 msg = e->params()[0];
326 if(Netsplit::isNetsplit(msg)) {
328 if(!_netsplits[e->network()].contains(msg)) {
329 n = new Netsplit(e->network(), this);
330 connect(n, SIGNAL(finished()), this, SLOT(handleNetsplitFinished()));
331 connect(n, SIGNAL(netsplitJoin(Network*,QString,QStringList,QStringList,QString)),
332 this, SLOT(handleNetsplitJoin(Network*,QString,QStringList,QStringList,QString)));
333 connect(n, SIGNAL(netsplitQuit(Network*,QString,QStringList,QString)),
334 this, SLOT(handleNetsplitQuit(Network*,QString,QStringList,QString)));
335 connect(n, SIGNAL(earlyJoin(Network*,QString,QStringList,QStringList)),
336 this, SLOT(handleEarlyNetsplitJoin(Network*,QString,QStringList,QStringList)));
337 _netsplits[e->network()].insert(msg, n);
340 n = _netsplits[e->network()][msg];
342 // add this user to the netsplit
343 n->userQuit(e->prefix(), ircuser->channels(), msg);
344 e->setFlag(EventManager::Netsplit);
346 // normal quit is handled in lateProcessIrcEventQuit()
349 void CoreSessionEventProcessor::lateProcessIrcEventQuit(IrcEvent *e) {
350 if(e->testFlag(EventManager::Netsplit))
353 IrcUser *ircuser = e->network()->updateNickFromMask(e->prefix());
360 void CoreSessionEventProcessor::processIrcEventTopic(IrcEvent *e) {
361 if(checkParamCount(e, 2)) {
362 e->network()->updateNickFromMask(e->prefix());
363 IrcChannel *channel = e->network()->ircChannel(e->params().at(0));
365 channel->setTopic(e->params().at(1));
370 void CoreSessionEventProcessor::processIrcEvent001(IrcEvent *e) {
371 if(!checkParamCount(e, 1))
374 QString myhostmask = e->params().at(0).section(' ', -1, -1);
375 e->network()->setCurrentServer(e->prefix());
376 e->network()->setMyNick(nickFromMask(myhostmask));
380 // TODO Complete 005 handling, also use sensible defaults for non-sent stuff
381 void CoreSessionEventProcessor::processIrcEvent005(IrcEvent *e) {
382 if(!checkParamCount(e, 1))
386 for(int i = 0; i < e->params().count() - 1; i++) {
387 QString key = e->params()[i].section("=", 0, 0);
388 QString value = e->params()[i].section("=", 1);
389 e->network()->addSupport(key, value);
392 /* determine our prefixes here to get an accurate result */
393 e->network()->determinePrefixes();
396 /* RPL_UMODEIS - "<user_modes> [<user_mode_params>]" */
397 void CoreSessionEventProcessor::processIrcEvent221(IrcEvent *) {
398 // TODO: save information in network object
401 /* RPL_STATSCONN - "Highest connection cout: 8000 (7999 clients)" */
402 void CoreSessionEventProcessor::processIrcEvent250(IrcEvent *) {
403 // TODO: save information in network object
406 /* RPL_LOCALUSERS - "Current local user: 5024 Max: 7999 */
407 void CoreSessionEventProcessor::processIrcEvent265(IrcEvent *) {
408 // TODO: save information in network object
411 /* RPL_GLOBALUSERS - "Current global users: 46093 Max: 47650" */
412 void CoreSessionEventProcessor::processIrcEvent266(IrcEvent *) {
413 // TODO: save information in network object
418 Replies 311 - 313, 317 - 319 are all replies generated in response to a WHOIS message.
420 "<nick> :<away message>"
422 Replies 352 and 315 paired are used to answer a WHO message.
425 Replies 314 and 369 are responses to a WHOWAS message.
429 /* RPL_AWAY - "<nick> :<away message>" */
430 void CoreSessionEventProcessor::processIrcEvent301(IrcEvent *e) {
431 if(!checkParamCount(e, 2))
434 IrcUser *ircuser = e->network()->ircUser(e->params().at(0));
436 ircuser->setAway(true);
437 ircuser->setAwayMessage(e->params().at(1));
438 //ircuser->setLastAwayMessage(now);
442 /* RPL_UNAWAY - ":You are no longer marked as being away" */
443 void CoreSessionEventProcessor::processIrcEvent305(IrcEvent *e) {
444 IrcUser *me = e->network()->me();
448 if(e->network()->autoAwayActive()) {
449 e->network()->setAutoAwayActive(false);
450 e->setFlag(EventManager::Silent);
454 /* RPL_NOWAWAY - ":You have been marked as being away" */
455 void CoreSessionEventProcessor::processIrcEvent306(IrcEvent *e) {
456 IrcUser *me = e->network()->me();
461 /* RPL_WHOISSERVICE - "<user> is registered nick" */
462 void CoreSessionEventProcessor::processIrcEvent307(IrcEvent *e) {
463 if(!checkParamCount(e, 1))
466 IrcUser *ircuser = e->network()->ircUser(e->params().at(0));
468 ircuser->setWhoisServiceReply(e->params().join(" "));
471 /* RPL_SUSERHOST - "<user> is available for help." */
472 void CoreSessionEventProcessor::processIrcEvent310(IrcEvent *e) {
473 if(!checkParamCount(e, 1))
476 IrcUser *ircuser = e->network()->ircUser(e->params().at(0));
478 ircuser->setSuserHost(e->params().join(" "));
481 /* RPL_WHOISUSER - "<nick> <user> <host> * :<real name>" */
482 void CoreSessionEventProcessor::processIrcEvent311(IrcEvent *e) {
483 if(!checkParamCount(e, 3))
486 IrcUser *ircuser = e->network()->ircUser(e->params().at(0));
488 ircuser->setUser(e->params().at(1));
489 ircuser->setHost(e->params().at(2));
490 ircuser->setRealName(e->params().last());
494 /* RPL_WHOISSERVER - "<nick> <server> :<server info>" */
495 void CoreSessionEventProcessor::processIrcEvent312(IrcEvent *e) {
496 if(!checkParamCount(e, 2))
499 IrcUser *ircuser = e->network()->ircUser(e->params().at(0));
501 ircuser->setServer(e->params().at(1));
504 /* RPL_WHOISOPERATOR - "<nick> :is an IRC operator" */
505 void CoreSessionEventProcessor::processIrcEvent313(IrcEvent *e) {
506 if(!checkParamCount(e, 1))
509 IrcUser *ircuser = e->network()->ircUser(e->params().at(0));
511 ircuser->setIrcOperator(e->params().last());
514 /* RPL_ENDOFWHO: "<name> :End of WHO list" */
515 void CoreSessionEventProcessor::processIrcEvent315(IrcEvent *e) {
516 if(!checkParamCount(e, 1))
519 if(coreNetwork(e)->setAutoWhoDone(e->params()[0]))
520 e->setFlag(EventManager::Silent);
523 /* RPL_WHOISIDLE - "<nick> <integer> :seconds idle"
524 (real life: "<nick> <integer> <integer> :seconds idle, signon time) */
525 void CoreSessionEventProcessor::processIrcEvent317(IrcEvent *e) {
526 if(!checkParamCount(e, 2))
531 int idleSecs = e->params()[1].toInt();
532 if(e->params().count() > 3) { // if we have more then 3 params we have the above mentioned "real life" situation
533 int logintime = e->params()[2].toInt();
534 loginTime = QDateTime::fromTime_t(logintime);
537 IrcUser *ircuser = e->network()->ircUser(e->params()[0]);
539 ircuser->setIdleTime(e->timestamp().addSecs(-idleSecs));
540 if(loginTime.isValid())
541 ircuser->setLoginTime(loginTime);
545 /* RPL_LIST - "<channel> <# visible> :<topic>" */
546 void CoreSessionEventProcessor::processIrcEvent322(IrcEvent *e) {
547 if(!checkParamCount(e, 1))
551 quint32 userCount = 0;
554 switch(e->params().count()) {
556 topic = e->params()[2];
558 userCount = e->params()[1].toUInt();
560 channelName = e->params()[0];
564 if(coreSession()->ircListHelper()->addChannel(e->networkId(), channelName, userCount, topic))
565 e->stop(); // consumed by IrcListHelper, so don't further process/show this event
568 /* RPL_LISTEND ":End of LIST" */
569 void CoreSessionEventProcessor::processIrcEvent323(IrcEvent *e) {
570 if(!checkParamCount(e, 1))
573 if(coreSession()->ircListHelper()->endOfChannelList(e->networkId()))
574 e->stop(); // consumed by IrcListHelper, so don't further process/show this event
577 /* RPL_CHANNELMODEIS - "<channel> <mode> <mode params>" */
578 void CoreSessionEventProcessor::processIrcEvent324(IrcEvent *e) {
579 processIrcEventMode(e);
583 void CoreSessionEventProcessor::processIrcEvent331(IrcEvent *e) {
584 if(!checkParamCount(e, 1))
587 IrcChannel *chan = e->network()->ircChannel(e->params()[0]);
589 chan->setTopic(QString());
593 void CoreSessionEventProcessor::processIrcEvent332(IrcEvent *e) {
594 if(!checkParamCount(e, 2))
597 IrcChannel *chan = e->network()->ircChannel(e->params()[0]);
599 chan->setTopic(e->params()[1]);
602 /* RPL_WHOREPLY: "<channel> <user> <host> <server> <nick>
603 ( "H" / "G" > ["*"] [ ( "@" / "+" ) ] :<hopcount> <real name>" */
604 void CoreSessionEventProcessor::processIrcEvent352(IrcEvent *e) {
605 if(!checkParamCount(e, 6))
608 QString channel = e->params()[0];
609 IrcUser *ircuser = e->network()->ircUser(e->params()[4]);
611 ircuser->setUser(e->params()[1]);
612 ircuser->setHost(e->params()[2]);
614 bool away = e->params()[5].startsWith("G");
615 ircuser->setAway(away);
616 ircuser->setServer(e->params()[3]);
617 ircuser->setRealName(e->params().last().section(" ", 1));
620 if(coreNetwork(e)->isAutoWhoInProgress(channel))
621 e->setFlag(EventManager::Silent);
625 void CoreSessionEventProcessor::processIrcEvent353(IrcEvent *e) {
626 if(!checkParamCount(e, 3))
629 // param[0] is either "=", "*" or "@" indicating a public, private or secret channel
630 // we don't use this information at the time beeing
631 QString channelname = e->params()[1];
633 IrcChannel *channel = e->network()->ircChannel(channelname);
635 qWarning() << Q_FUNC_INFO << "Received unknown target channel:" << channelname;
642 foreach(QString nick, e->params()[2].split(' ')) {
645 if(e->network()->prefixes().contains(nick[0])) {
646 mode = e->network()->prefixToMode(nick[0]);
654 channel->joinIrcUsers(nicks, modes);
657 /* ERR_ERRONEUSNICKNAME */
658 void CoreSessionEventProcessor::processIrcEvent432(IrcEventNumeric *e) {
660 if(e->params().count() < 2) {
661 // handle unreal-ircd bug, where unreal ircd doesnt supply a TARGET in ERR_ERRONEUSNICKNAME during registration phase:
663 // :irc.scortum.moep.net 432 @@@ :Erroneous Nickname: Illegal characters
664 // correct server reply:
665 // :irc.scortum.moep.net 432 * @@@ :Erroneous Nickname: Illegal characters
666 e->params().prepend(e->target());
669 errnick = e->params()[0];
671 tryNextNick(e, errnick, true /* erroneus */);
674 /* ERR_NICKNAMEINUSE */
675 void CoreSessionEventProcessor::processIrcEvent433(IrcEventNumeric *e) {
676 if(!checkParamCount(e, 1))
679 QString errnick = e->params().first();
681 // if there is a problem while connecting to the server -> we handle it
682 // but only if our connection has not been finished yet...
683 if(!e->network()->currentServer().isEmpty())
686 tryNextNick(e, errnick);
689 /* ERR_UNAVAILRESOURCE */
690 void CoreSessionEventProcessor::processIrcEvent437(IrcEventNumeric *e) {
691 if(!checkParamCount(e, 1))
694 QString errnick = e->params().first();
696 // if there is a problem while connecting to the server -> we handle it
697 // but only if our connection has not been finished yet...
698 if(!e->network()->currentServer().isEmpty())
701 if(!e->network()->isChannelName(errnick))
702 tryNextNick(e, errnick);
706 void CoreSessionEventProcessor::processIrcEvent(IrcEvent *e) {
707 if(!checkParamCount(e, 1))
713 /* Handle signals from Netsplit objects */
715 void CoreSessionEventProcessor::handleNetsplitJoin(Network *net,
716 const QString &channel,
717 const QStringList &users,
718 const QStringList &modes,
719 const QString& quitMessage)
721 IrcChannel *ircChannel = net->ircChannel(channel);
725 QList<IrcUser *> ircUsers;
726 QStringList newModes = modes;
727 QStringList newUsers = users;
729 foreach(const QString &user, users) {
730 IrcUser *iu = net->ircUser(nickFromMask(user));
733 else { // the user already quit
734 int idx = users.indexOf(user);
735 newUsers.removeAt(idx);
736 newModes.removeAt(idx);
740 ircChannel->joinIrcUsers(ircUsers, newModes);
741 NetworkSplitEvent *event = new NetworkSplitEvent(EventManager::NetworkSplitJoin, net, channel, newUsers, quitMessage);
742 coreSession()->eventManager()->sendEvent(event);
745 void CoreSessionEventProcessor::handleNetsplitQuit(Network *net, const QString &channel, const QStringList &users, const QString& quitMessage) {
746 NetworkSplitEvent *event = new NetworkSplitEvent(EventManager::NetworkSplitQuit, net, channel, users, quitMessage);
747 coreSession()->eventManager()->sendEvent(event);
748 foreach(QString user, users) {
749 IrcUser *iu = net->ircUser(nickFromMask(user));
755 void CoreSessionEventProcessor::handleEarlyNetsplitJoin(Network *net, const QString &channel, const QStringList &users, const QStringList &modes) {
756 IrcChannel *ircChannel = net->ircChannel(channel);
758 qDebug() << "handleEarlyNetsplitJoin(): channel " << channel << " invalid";
761 QList<NetworkEvent *> events;
762 QList<IrcUser *> ircUsers;
763 QStringList newModes = modes;
765 foreach(QString user, users) {
766 IrcUser *iu = net->updateNickFromMask(user);
769 // fake event for scripts that consume join events
770 events << new IrcEvent(EventManager::IrcEventJoin, net, iu->hostmask(), QStringList() << channel);
773 newModes.removeAt(users.indexOf(user));
776 ircChannel->joinIrcUsers(ircUsers, newModes);
777 foreach(NetworkEvent *event, events) {
778 event->setFlag(EventManager::Fake); // ignore this in here!
779 coreSession()->eventManager()->sendEvent(event);
783 void CoreSessionEventProcessor::handleNetsplitFinished() {
784 Netsplit* n = qobject_cast<Netsplit*>(sender());
786 QHash<QString, Netsplit *> splithash = _netsplits.take(n->network());
787 splithash.remove(splithash.key(n));
788 if(splithash.count())
789 _netsplits[n->network()] = splithash;
793 void CoreSessionEventProcessor::destroyNetsplits(NetworkId netId) {
794 Network *net = coreSession()->network(netId);
798 QHash<QString, Netsplit *> splits = _netsplits.take(net);