From fd98e60a1da39999248abb3d864ff12931736ac9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Mon, 2 Mar 2020 23:20:03 +0100 Subject: Avoid nick changes when joining a room that was already joined By an other resource, or anything fix #3423 --- src/xmpp/biboumi_component.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/xmpp/biboumi_component.cpp b/src/xmpp/biboumi_component.cpp index 6fe6972..6c0d0e9 100644 --- a/src/xmpp/biboumi_component.cpp +++ b/src/xmpp/biboumi_component.cpp @@ -183,15 +183,10 @@ void BiboumiComponent::handle_presence(const Stanza& stanza) if (history->get_tag("maxchars") == "0") history_limit.stanzas = 0; } - bridge->join_irc_channel(iid, to.resource, password ? password->get_inner(): "", + const bool was_really_a_join = bridge->join_irc_channel(iid, to.resource, password ? password->get_inner(): "", from.resource, history_limit, x != nullptr); - 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); - } + if (!was_really_a_join) + bridge->send_irc_nick_change(iid, to.resource, from.resource); } else if (type == "unavailable") { -- cgit v1.2.3