X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fircuser.cpp;h=ec1ecb1c93c903c93b3386fbf30a4c9da29b3b92;hp=fbfdf960c94dec9f7277e9c2e743a0b015ce866e;hb=7298446b3e86140c4bbbfe7aeeb959c16c53363c;hpb=a95ad2de573027f9bee36db972bcae4195168d0c diff --git a/src/common/ircuser.cpp b/src/common/ircuser.cpp index fbfdf960..ec1ecb1c 100644 --- a/src/common/ircuser.cpp +++ b/src/common/ircuser.cpp @@ -291,17 +291,9 @@ void IrcUser::joinChannel(const QString& channelname) joinChannel(network()->newIrcChannel(channelname)); } -void IrcUser::partChannel(IrcChannel* channel, bool skip_sync) +void IrcUser::partChannel(IrcChannel* channel) { - if (_channels.contains(channel)) { - _channels.remove(channel); - disconnect(channel, nullptr, this, nullptr); - channel->part(this); - QString channelName = channel->name(); - if (!skip_sync) SYNC_OTHER(partChannel, ARG(channelName)) - if (_channels.isEmpty() && !network()->isMe(this)) - quit(skip_sync); - } + partChannelInternal(channel, false); } void IrcUser::partChannel(const QString& channelname) @@ -315,7 +307,25 @@ void IrcUser::partChannel(const QString& channelname) } } -void IrcUser::quit(bool skip_sync) +void IrcUser::partChannelInternal(IrcChannel* channel, bool skip_sync) +{ + if (_channels.contains(channel)) { + _channels.remove(channel); + disconnect(channel, nullptr, this, nullptr); + channel->part(this); + QString channelName = channel->name(); + if (!skip_sync) SYNC_OTHER(partChannel, ARG(channelName)) + if (_channels.isEmpty() && !network()->isMe(this)) + quitInternal(skip_sync); + } +} + +void IrcUser::quit() +{ + quitInternal(false); +} + +void IrcUser::quitInternal(bool skip_sync) { QList channels = _channels.values(); _channels.clear();