diff options
Diffstat (limited to 'src/mod_vcard_ldap.erl')
-rw-r--r-- | src/mod_vcard_ldap.erl | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/mod_vcard_ldap.erl b/src/mod_vcard_ldap.erl index 7711353d2..1c96dd4a1 100644 --- a/src/mod_vcard_ldap.erl +++ b/src/mod_vcard_ldap.erl @@ -38,7 +38,7 @@ -export([start/2, start_link/2, stop/1, get_sm_features/5, process_local_iq/3, process_sm_iq/3, - remove_user/1, route/4]). + remove_user/1, route/4, transform_module_options/1]). -include("ejabberd.hrl"). -include("logger.hrl"). @@ -767,7 +767,7 @@ parse_options(Host, Opts) -> VCardMap = gen_mod:get_opt(ldap_vcard_map, Opts, fun(Ls) -> lists:map( - fun({S, P, L}) -> + fun({S, [{P, L}]}) -> {iolist_to_binary(S), iolist_to_binary(P), [iolist_to_binary(E) @@ -823,6 +823,20 @@ parse_options(Host, Opts) -> search_reported_attrs = SearchReportedAttrs, matches = Matches}. +transform_module_options(Opts) -> + lists:map( + fun({ldap_vcard_map, Map}) -> + NewMap = lists:map( + fun({Field, Pattern, Attrs}) -> + {Field, [{Pattern, Attrs}]}; + (Opt) -> + Opt + end, Map), + {ldap_vcard_map, NewMap}; + (Opt) -> + Opt + end, Opts). + check_filter(F) -> NewF = iolist_to_binary(F), {ok, _} = eldap_filter:parse(NewF), |