mod_jidprep: Don't call gen_mod functions directly

This commit is contained in:
Holger Weiss 2019-09-18 17:39:40 +02:00
parent fd4c5edc23
commit f48b4124b1
2 changed files with 15 additions and 2 deletions

View File

@ -93,7 +93,7 @@ disco_local_features(empty, From, To, Node, Lang) ->
disco_local_features({result, []}, From, To, Node, Lang);
disco_local_features({result, OtherFeatures} = Acc, From,
#jid{lserver = LServer}, <<"">>, _Lang) ->
Access = gen_mod:get_module_opt(LServer, ?MODULE, access),
Access = mod_jidprep_opt:access(LServer),
case acl:match_rule(LServer, Access, From) of
allow ->
{result, [?NS_JIDPREP_0 | OtherFeatures]};
@ -123,7 +123,7 @@ process_iq(#iq{from = From, to = #jid{lserver = LServer}, lang = Lang,
sub_els = [#jidprep{jid = #jid{luser = U,
lserver = S,
lresource = R} = JID}]} = IQ) ->
Access = gen_mod:get_module_opt(LServer, ?MODULE, access),
Access = mod_jidprep_opt:access(LServer),
case acl:match_rule(LServer, Access, From) of
allow ->
case jid:make(U, S, R) of

13
src/mod_jidprep_opt.erl Normal file
View File

@ -0,0 +1,13 @@
%% Generated automatically
%% DO NOT EDIT: run `make options` instead
-module(mod_jidprep_opt).
-export([access/1]).
-spec access(gen_mod:opts() | global | binary()) -> 'local' | acl:acl().
access(Opts) when is_map(Opts) ->
gen_mod:get_opt(access, Opts);
access(Host) ->
gen_mod:get_module_opt(Host, mod_jidprep, access).