25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +01:00

Do not change to attribute of sent messages from bare to full jid

This is not correct per xmpp spec
This commit is contained in:
Paweł Chmielowski 2020-03-25 16:00:16 +01:00
parent 633b362577
commit 1ffa9a0cf5

View File

@ -937,7 +937,11 @@ fix_from_to(Pkt, #{jid := JID}) when ?is_stanza(Pkt) ->
{U, S, _} -> jid:replace_resource(JID, From#jid.resource);
_ -> From
end,
xmpp:set_from_to(Pkt, From1, JID)
To1 = case xmpp:get_to(Pkt) of
#jid{lresource = <<>>} = To2 -> To2;
_ -> JID
end,
xmpp:set_from_to(Pkt, From1, To1)
end;
fix_from_to(Pkt, _State) ->
Pkt.