aboutsummaryrefslogtreecommitdiff
path: root/src/mod_disco.erl
diff options
context:
space:
mode:
authorEvgeniy Khramtsov <ekhramtsov@process-one.net>2015-06-01 15:38:27 +0300
committerEvgeniy Khramtsov <ekhramtsov@process-one.net>2015-06-01 15:38:27 +0300
commitfb6267f38ee47f3f725f88324d132741c85dfb6a (patch)
treed63c5efd207a736f9215d645ccb881bba942ed6a /src/mod_disco.erl
parentDo not try to fetch module options via eldap_utils (diff)
Add config validation at startup
Diffstat (limited to '')
-rw-r--r--src/mod_disco.erl17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/mod_disco.erl b/src/mod_disco.erl
index c0ab9a9ac..afa7d3908 100644
--- a/src/mod_disco.erl
+++ b/src/mod_disco.erl
@@ -39,7 +39,7 @@
get_sm_identity/5, get_sm_features/5, get_sm_items/5,
get_info/5, register_feature/2, unregister_feature/2,
register_extra_domain/2, unregister_extra_domain/2,
- transform_module_options/1]).
+ transform_module_options/1, mod_opt_type/1]).
-include("ejabberd.hrl").
-include("logger.hrl").
@@ -519,3 +519,18 @@ values_to_xml(Values) ->
children = [{xmlcdata, Value}]}
end,
Values).
+
+mod_opt_type(extra_domains) ->
+ fun (Hs) -> [iolist_to_binary(H) || H <- Hs] end;
+mod_opt_type(iqdisc) -> fun gen_iq_handler:check_type/1;
+mod_opt_type(server_info) ->
+ fun (L) ->
+ lists:map(fun (Opts) ->
+ Mods = proplists:get_value(modules, Opts, all),
+ Name = proplists:get_value(name, Opts, <<>>),
+ URLs = proplists:get_value(urls, Opts, []),
+ {Mods, Name, URLs}
+ end,
+ L)
+ end;
+mod_opt_type(_) -> [extra_domains, iqdisc, server_info].