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

Return error stanza when storage doesn't support vcard update (#4266)

This commit is contained in:
Badlop 2024-08-16 10:55:55 +02:00
parent e99fe98db4
commit 6110f213de

View File

@ -398,13 +398,17 @@ vcard_iq_set(#iq{from = From, lang = Lang, sub_els = [VCard]} = IQ) ->
%% Should not be here?
Txt = ?T("Nodeprep has failed"),
{stop, xmpp:err_internal_server_error(Txt, Lang)};
{error, not_implemented} ->
Txt = ?T("Updating the vCard is not supported by the vCard storage backend"),
{stop, xmpp:err_feature_not_implemented(Txt, Lang)};
ok ->
IQ
end;
vcard_iq_set(Acc) ->
Acc.
-spec set_vcard(binary(), binary(), xmlel() | vcard_temp()) -> {error, badarg|binary()} | ok.
-spec set_vcard(binary(), binary(), xmlel() | vcard_temp()) ->
{error, badarg | not_implemented | binary()} | ok.
set_vcard(User, LServer, VCARD) ->
case jid:nodeprep(User) of
error ->