+
+ QStringList newNicks;
+ QStringList newModes;
+ QList<IrcUser *> newUsers;
+
+ IrcUser *ircuser;
+ for(int i = 0; i < users.count(); i++) {
+ ircuser = users[i];
+ if(!ircuser || _userModes.contains(ircuser))
+ continue;
+
+ _userModes[ircuser] = modes[i];
+ ircuser->joinChannel(this);
+ //qDebug() << "JOIN" << name() << ircuser->nick() << ircUsers().count();
+ connect(ircuser, SIGNAL(nickSet(QString)), this, SLOT(ircUserNickSet(QString)));
+ connect(ircuser, SIGNAL(destroyed()), this, SLOT(ircUserDestroyed()));
+ // if you wonder why there is no counterpart to ircUserJoined:
+ // the joines are propagted by the ircuser. the signal ircUserJoined is only for convenience
+
+ newNicks << ircuser->nick();
+ newModes << modes[i];
+ newUsers << ircuser;
+ }
+
+ if(newNicks.isEmpty())
+ return;
+
+ emit ircUsersJoined(newUsers);
+ emit ircUsersJoined(newNicks, newModes);