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
+2 -7
View File
@@ -183,16 +183,11 @@ 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)
if (!was_really_a_join)
bridge->send_irc_nick_change(iid, to.resource, from.resource);
}
}
else if (type == "unavailable")
{
const XmlNode* status = stanza.get_child("status", COMPONENT_NS);