25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-20 16:15:59 +01:00

When occupant changes nick, include status 110 in stanzas sent to him

This commit is contained in:
Badlop 2014-02-14 16:22:14 +01:00
parent 4c8b6fe16b
commit 63a7011c38

View File

@ -2334,6 +2334,14 @@ send_nick_changing(JID, OldNick, StateData,
[{<<"affiliation">>, SAffiliation}, [{<<"affiliation">>, SAffiliation},
{<<"role">>, SRole}] {<<"role">>, SRole}]
end, end,
Status110 = case JID == Info#user.jid of
true ->
[#xmlel{name = <<"status">>,
attrs = [{<<"code">>, <<"110">>}]
}];
false ->
[]
end,
Packet1 = #xmlel{name = <<"presence">>, Packet1 = #xmlel{name = <<"presence">>,
attrs = attrs =
[{<<"type">>, [{<<"type">>,
@ -2356,7 +2364,7 @@ send_nick_changing(JID, OldNick, StateData,
[{<<"code">>, [{<<"code">>,
<<"303">>}], <<"303">>}],
children = children =
[]}]}]}, []}|Status110]}]},
Packet2 = xml:append_subtags(Presence, Packet2 = xml:append_subtags(Presence,
[#xmlel{name = <<"x">>, [#xmlel{name = <<"x">>,
attrs = attrs =
@ -2371,7 +2379,7 @@ send_nick_changing(JID, OldNick, StateData,
ItemAttrs2, ItemAttrs2,
children children
= =
[]}]}]), []}|Status110]}]),
if SendOldUnavailable -> if SendOldUnavailable ->
ejabberd_router:route(jlib:jid_replace_resource(StateData#state.jid, ejabberd_router:route(jlib:jid_replace_resource(StateData#state.jid,
OldNick), OldNick),