}
_userModes[ircuser] = modes[i];
- ircuser->joinChannel(this);
+ ircuser->joinChannel(this, true);
connect(ircuser, SIGNAL(nickSet(QString)), this, SLOT(ircUserNickSet(QString)));
// connect(ircuser, SIGNAL(destroyed()), this, SLOT(ircUserDestroyed()));
}
-void IrcUser::joinChannel(IrcChannel *channel)
+void IrcUser::joinChannel(IrcChannel *channel, bool skip_channel_join)
{
Q_ASSERT(channel);
if (!_channels.contains(channel)) {
_channels.insert(channel);
- channel->joinIrcUser(this);
+ if (!skip_channel_join)
+ channel->joinIrcUser(this);
}
}
void setUserModes(const QString &modes);
- void joinChannel(IrcChannel *channel);
+ /*!
+ * \brief joinChannel Called when user joins some channel, this function inserts the channel to internal list of channels this user is in.
+ * \param channel Pointer to a channel this user just joined
+ * \param skip_channel_join If this is false, this function will also call IrcChannel::joinIrcUser, can be set to true as a performance tweak.
+ */
+ void joinChannel(IrcChannel *channel, bool skip_channel_join = false);
void joinChannel(const QString &channelname);
void partChannel(IrcChannel *channel);
void partChannel(const QString &channelname);