From 88fe1783bfd58ea0dca9e9e507a046e5c982b779 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Mon, 17 Sep 2018 22:36:59 +0200 Subject: Do not change our nick if we send a presence to a non-joined channel fix #3378 --- src/xmpp/biboumi_component.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/xmpp') diff --git a/src/xmpp/biboumi_component.cpp b/src/xmpp/biboumi_component.cpp index 85617e8..4ed47cf 100644 --- a/src/xmpp/biboumi_component.cpp +++ b/src/xmpp/biboumi_component.cpp @@ -185,8 +185,13 @@ void BiboumiComponent::handle_presence(const Stanza& stanza) } bridge->join_irc_channel(iid, to.resource, password ? password->get_inner(): "", from.resource, history_limit, x != nullptr); - if (!own_nick.empty() && own_nick != to.resource) - bridge->send_irc_nick_change(iid, to.resource, from.resource); + const IrcClient* irc = bridge->find_irc_client(iid.get_server()); + if (irc) + { + const auto chan = irc->find_channel(iid.get_local()); + if (chan->joined) + bridge->send_irc_nick_change(iid, to.resource, from.resource); + } } else if (type == "unavailable") { -- cgit v1.2.3