mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-24 16:23:40 +01:00
mod_jidprep: Don't call gen_mod functions directly
This commit is contained in:
parent
fd4c5edc23
commit
f48b4124b1
@ -93,7 +93,7 @@ disco_local_features(empty, From, To, Node, Lang) ->
|
|||||||
disco_local_features({result, []}, From, To, Node, Lang);
|
disco_local_features({result, []}, From, To, Node, Lang);
|
||||||
disco_local_features({result, OtherFeatures} = Acc, From,
|
disco_local_features({result, OtherFeatures} = Acc, From,
|
||||||
#jid{lserver = LServer}, <<"">>, _Lang) ->
|
#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
|
case acl:match_rule(LServer, Access, From) of
|
||||||
allow ->
|
allow ->
|
||||||
{result, [?NS_JIDPREP_0 | OtherFeatures]};
|
{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,
|
sub_els = [#jidprep{jid = #jid{luser = U,
|
||||||
lserver = S,
|
lserver = S,
|
||||||
lresource = R} = JID}]} = IQ) ->
|
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
|
case acl:match_rule(LServer, Access, From) of
|
||||||
allow ->
|
allow ->
|
||||||
case jid:make(U, S, R) of
|
case jid:make(U, S, R) of
|
||||||
|
13
src/mod_jidprep_opt.erl
Normal file
13
src/mod_jidprep_opt.erl
Normal 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).
|
||||||
|
|
Loading…
Reference in New Issue
Block a user