25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-26 17:38:45 +01:00

Return an empty <vCard/> element in an IQ-result when no vCard exists.

According to XEP-0054, if no vCard exists, the server MUST return a stanza
error (which SHOULD be <item-not-found/>) or an IQ-result containing an
empty <vCard/> element.

Signed-off-by: Gu Feng <flygoast@126.com>
This commit is contained in:
Gu Feng 2014-10-25 00:55:49 +08:00
parent bf33f74ef8
commit 94cdcd7b34

View File

@ -186,6 +186,11 @@ process_sm_iq(From, To,
error -> error ->
IQ#iq{type = error, IQ#iq{type = error,
sub_el = [SubEl, ?ERR_INTERNAL_SERVER_ERROR]}; sub_el = [SubEl, ?ERR_INTERNAL_SERVER_ERROR]};
[] ->
IQ#iq{type = result,
sub_el = [#xmlel{name = <<"vCard">>,
attrs = [{<<"xmlns">>, ?NS_VCARD}],
children = []}]};
Els -> IQ#iq{type = result, sub_el = Els} Els -> IQ#iq{type = result, sub_el = Els}
end end
end. end.