-
-void BufferItem::attachIrcChannel(IrcChannel *ircChannel) {
- if(!ircChannel)
- return;
-
- _ircChannel = ircChannel;
-
- connect(ircChannel, SIGNAL(topicSet(QString)),
- this, SLOT(setTopic(QString)));
- connect(ircChannel, SIGNAL(ircUserJoined(IrcUser *)),
- this, SLOT(join(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()) {
- qWarning() << "Channel" << ircChannel->name() << "has already users which is quite surprising :)";
- foreach(IrcUser *ircUser, ircChannel->ircUsers()) {
- join(ircUser);
- }
- }
-
- emit dataChanged();