diff options
author | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2018-01-23 10:54:52 +0300 |
---|---|---|
committer | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2018-01-23 10:54:52 +0300 |
commit | ba2b650464bd3aae2b6b0f3a3177476360cb6d08 (patch) | |
tree | 5d55501f76edcdcfe145ba0c3367a54ea0314e5c /src/mod_http_api.erl | |
parent | Do not try to start ezlib application too frequently (diff) |
Introduce new gen_mod callback: mod_options/1
The callback is supposed to provide known options and their default
values, as long as the documentation. Passing default values into
get_mod functions is now deprecated: all defaults should be provided
by the Mod:mod_options/1 callback.
Diffstat (limited to 'src/mod_http_api.erl')
-rw-r--r-- | src/mod_http_api.erl | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mod_http_api.erl b/src/mod_http_api.erl index 2b818840d..d403e3aa9 100644 --- a/src/mod_http_api.erl +++ b/src/mod_http_api.erl @@ -74,7 +74,8 @@ -behaviour(gen_mod). --export([start/2, stop/1, reload/3, process/2, mod_opt_type/1, depends/2]). +-export([start/2, stop/1, reload/3, process/2, mod_opt_type/1, depends/2, + mod_options/1]). -include("ejabberd.hrl"). -include("xmpp.hrl"). @@ -551,7 +552,7 @@ hide_sensitive_args(NonListArgs) -> NonListArgs. permission_addon() -> - Access = gen_mod:get_module_opt(global, ?MODULE, admin_ip_access, none), + Access = gen_mod:get_module_opt(global, ?MODULE, admin_ip_access), Rules = acl:resolve_access(Access, global), R = case Rules of all -> @@ -576,5 +577,5 @@ permission_addon() -> end, {1, []}, R), Res. -mod_opt_type(admin_ip_access) -> fun acl:access_rules_validator/1; -mod_opt_type(_) -> [admin_ip_access]. +mod_opt_type(admin_ip_access) -> fun acl:access_rules_validator/1. +mod_options(_) -> [{admin_ip_access, none}]. |