- IrcChannel *ircChannel = net->ircChannel(channel);
- if(!ircChannel) {
- return;
- }
- QList<IrcUser *> ircUsers;
- QStringList newModes = modes;
- QStringList newUsers = users;
-
- foreach(const QString &user, users) {
- IrcUser *iu = net->ircUser(nickFromMask(user));
- if(iu)
- ircUsers.append(iu);
- else { // the user already quit
- int idx = users.indexOf(user);
- newUsers.removeAt(idx);
- newModes.removeAt(idx);
- }
- }
-
- ircChannel->joinIrcUsers(ircUsers, newModes);
- NetworkSplitEvent *event = new NetworkSplitEvent(EventManager::NetworkSplitJoin, net, channel, newUsers, quitMessage);
- coreSession()->eventManager()->sendEvent(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);
- foreach(QString user, users) {
- IrcUser *iu = net->ircUser(nickFromMask(user));
- if(iu)
- iu->quit();
- }
-}
-
-void CoreSessionEventProcessor::handleEarlyNetsplitJoin(Network *net, const QString &channel, const QStringList &users, const QStringList &modes) {
- IrcChannel *ircChannel = net->ircChannel(channel);
- if(!ircChannel) {
- qDebug() << "handleEarlyNetsplitJoin(): channel " << channel << " invalid";
- return;
- }
- QList<NetworkEvent *> events;
- QList<IrcUser *> ircUsers;
- QStringList newModes = modes;
-
- foreach(QString user, users) {
- IrcUser *iu = net->updateNickFromMask(user);
- if(iu) {
- ircUsers.append(iu);
- // fake event for scripts that consume join events
- events << new IrcEvent(EventManager::IrcEventJoin, net, iu->hostmask(), QStringList() << channel);