diff options
author | louiz’ <louiz@louiz.org> | 2020-03-02 23:20:03 +0100 |
---|---|---|
committer | louiz’ <louiz@louiz.org> | 2020-03-02 23:20:54 +0100 |
commit | fd98e60a1da39999248abb3d864ff12931736ac9 (patch) | |
tree | 1f07df6a0fc7f9a50afda6c4b98a294fdeae4736 /src/xmpp | |
parent | 77c134a47b0e794080e424be393d778183fd1f37 (diff) | |
download | biboumi-fd98e60a1da39999248abb3d864ff12931736ac9.tar.gz biboumi-fd98e60a1da39999248abb3d864ff12931736ac9.tar.bz2 biboumi-fd98e60a1da39999248abb3d864ff12931736ac9.tar.xz biboumi-fd98e60a1da39999248abb3d864ff12931736ac9.zip |
Avoid nick changes when joining a room that was already joined
By an other resource, or anything
fix #3423
Diffstat (limited to 'src/xmpp')
-rw-r--r-- | src/xmpp/biboumi_component.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
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") { |