mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-24 16:23:40 +01:00
Return modules errors in set_vcard callback (#3502)
This commit is contained in:
parent
4bc57f76eb
commit
72ecf91f08
@ -403,7 +403,7 @@ vcard_iq_set(#iq{from = From, lang = Lang, sub_els = [VCard]} = IQ) ->
|
|||||||
vcard_iq_set(Acc) ->
|
vcard_iq_set(Acc) ->
|
||||||
Acc.
|
Acc.
|
||||||
|
|
||||||
-spec set_vcard(binary(), binary(), xmlel() | vcard_temp()) -> {error, badarg} | ok.
|
-spec set_vcard(binary(), binary(), xmlel() | vcard_temp()) -> {error, badarg|binary()} | ok.
|
||||||
set_vcard(User, LServer, VCARD) ->
|
set_vcard(User, LServer, VCARD) ->
|
||||||
case jid:nodeprep(User) of
|
case jid:nodeprep(User) of
|
||||||
error ->
|
error ->
|
||||||
@ -412,10 +412,14 @@ set_vcard(User, LServer, VCARD) ->
|
|||||||
VCardEl = xmpp:encode(VCARD),
|
VCardEl = xmpp:encode(VCARD),
|
||||||
VCardSearch = make_vcard_search(User, LUser, LServer, VCardEl),
|
VCardSearch = make_vcard_search(User, LUser, LServer, VCardEl),
|
||||||
Mod = gen_mod:db_mod(LServer, ?MODULE),
|
Mod = gen_mod:db_mod(LServer, ?MODULE),
|
||||||
Mod:set_vcard(LUser, LServer, VCardEl, VCardSearch),
|
case Mod:set_vcard(LUser, LServer, VCardEl, VCardSearch) of
|
||||||
|
{atomic, ok} ->
|
||||||
ets_cache:delete(?VCARD_CACHE, {LUser, LServer},
|
ets_cache:delete(?VCARD_CACHE, {LUser, LServer},
|
||||||
cache_nodes(Mod, LServer)),
|
cache_nodes(Mod, LServer)),
|
||||||
ok
|
ok;
|
||||||
|
{atomic, Error} ->
|
||||||
|
{error, Error}
|
||||||
|
end
|
||||||
end.
|
end.
|
||||||
|
|
||||||
-spec string2lower(binary()) -> binary().
|
-spec string2lower(binary()) -> binary().
|
||||||
|
Loading…
Reference in New Issue
Block a user