aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGu Feng <flygoast@126.com>2014-10-25 00:55:49 +0800
committerGu Feng <flygoast@126.com>2014-10-25 00:55:49 +0800
commit94cdcd7b34ccc83acfb32be09016cb7859d20916 (patch)
tree2fa9705385fb54b03fa96b619b51456d3a454dc7 /src
parentGet rid of a hyphen in VSN (diff)
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>
Diffstat (limited to 'src')
-rw-r--r--src/mod_vcard.erl5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mod_vcard.erl b/src/mod_vcard.erl
index 0451a5193..8afac260b 100644
--- a/src/mod_vcard.erl
+++ b/src/mod_vcard.erl
@@ -186,6 +186,11 @@ process_sm_iq(From, To,
error ->
IQ#iq{type = 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}
end
end.