summaryrefslogtreecommitdiff
path: root/src/bridge
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2016-10-05 00:17:22 +0200
committerlouiz’ <louiz@louiz.org>2016-10-05 00:18:22 +0200
commit3620d533ee88a8804317d2745320c0186192ddaa (patch)
tree9ef94df31a26691a7e259e7242931b95b45808a2 /src/bridge
parent55daa3e61c04946500c4106cfca7413b6e243435 (diff)
downloadbiboumi-3620d533ee88a8804317d2745320c0186192ddaa.tar.gz
biboumi-3620d533ee88a8804317d2745320c0186192ddaa.tar.bz2
biboumi-3620d533ee88a8804317d2745320c0186192ddaa.tar.xz
biboumi-3620d533ee88a8804317d2745320c0186192ddaa.zip
Avoid sending PART command for unjoined channels
fix #3205
Diffstat (limited to 'src/bridge')
-rw-r--r--src/bridge/bridge.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/bridge/bridge.cpp b/src/bridge/bridge.cpp
index 7724ba7..fb7ea42 100644
--- a/src/bridge/bridge.cpp
+++ b/src/bridge/bridge.cpp
@@ -360,7 +360,15 @@ void Bridge::leave_irc_channel(Iid&& iid, const std::string& status_message, con
const auto resources = this->number_of_resources_in_chan(key);
if (resources == 1)
{
- irc->send_part_command(iid.get_local(), status_message);
+ // Do not send a PART message if we actually are not in that channel
+ // or if we already sent a PART but we are just waiting for the
+ // acknowledgment from the server
+ IrcChannel* channel = irc->get_channel(iid.get_local());
+ if (channel->joined && !channel->parting)
+ {
+ irc->send_part_command(iid.get_local(), status_message);
+ channel->parting = true;
+ }
// Since there are no resources left in that channel, we don't
// want to receive private messages using this room's JID
this->remove_all_preferred_from_jid_of_room(iid.get_local());