-void IrcUser::joinChannel(const QString &channelname) {
- joinChannel(network()->newIrcChannel(channelname));
+
+void IrcUser::partChannel(IrcChannel *channel)
+{
+ if (_channels.contains(channel)) {
+ _channels.remove(channel);
+ disconnect(channel, 0, this, 0);
+ channel->part(this);
+ QString channelName = channel->name();
+ SYNC_OTHER(partChannel, ARG(channelName))
+ if (_channels.isEmpty() && !network()->isMe(this))
+ quit();
+ }