Avoid nick changes when joining a room that was already joined

By an other resource, or anything

fix #3423
This commit is contained in:
louiz’
2020-03-02 23:20:54 +01:00
parent 77c134a47b
commit fd98e60a1d
+3 -8
View File
@@ -183,15 +183,10 @@ void BiboumiComponent::handle_presence(const Stanza& stanza)
if (history->get_tag("maxchars") == "0") if (history->get_tag("maxchars") == "0")
history_limit.stanzas = 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); from.resource, history_limit, x != nullptr);
const IrcClient* irc = bridge->find_irc_client(iid.get_server()); if (!was_really_a_join)
if (irc) bridge->send_irc_nick_change(iid, to.resource, from.resource);
{
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") else if (type == "unavailable")
{ {