+void ChannelBufferItem::attachIrcChannel(IrcChannel *ircChannel) {
+ Q_ASSERT(!_ircChannel && ircChannel);
+
+ _ircChannel = ircChannel;
+
+ connect(ircChannel, SIGNAL(topicSet(QString)),
+ this, SLOT(setTopic(QString)));
+ connect(ircChannel, SIGNAL(ircUsersJoined(QList<IrcUser *>)),
+ this, SLOT(join(QList<IrcUser *>)));
+ connect(ircChannel, SIGNAL(ircUserParted(IrcUser *)),
+ this, SLOT(part(IrcUser *)));
+ connect(ircChannel, SIGNAL(destroyed()),
+ this, SLOT(ircChannelDestroyed()));
+ connect(ircChannel, SIGNAL(ircUserModesSet(IrcUser *, QString)),
+ this, SLOT(userModeChanged(IrcUser *)));
+ connect(ircChannel, SIGNAL(ircUserModeAdded(IrcUser *, QString)),
+ this, SLOT(userModeChanged(IrcUser *)));
+ connect(ircChannel, SIGNAL(ircUserModeRemoved(IrcUser *, QString)),
+ this, SLOT(userModeChanged(IrcUser *)));
+
+ if(!ircChannel->ircUsers().isEmpty())
+ join(ircChannel->ircUsers());
+
+ emit dataChanged();