- // we only need to check user and hostmask.
- // nick can't have changed since we're identifying IrcUsers by nick
-
- // we don't use setUser and setHost here.
- // though this is unpretty code duplication this saves us one emit objectNameSet()
- // the second one would be erroneous
-
- if(!user.isEmpty() && _user != user) {
- _user = user;
+void IrcUser::joinChannel(IrcChannel *channel) {
+ Q_ASSERT(channel);
+ if(!_channels.contains(channel)) {
+ channel->join(this);
+ connect(channel, SIGNAL(destroyed()), this, SLOT(channelDestroyed()));
+ _channels.insert(channel);
+ emit channelJoined(channel->name());