allow shared roster group placeholder in mqtt topic

This commit is contained in:
Robert Schuh 2021-04-08 16:33:54 +02:00 committed by Robert Schuh
parent 4468c87115
commit 0e93f70e38
2 changed files with 18 additions and 0 deletions

View File

@ -25,6 +25,7 @@
-export([match_rules/4, match_acls/3]).
-export([access_rules_validator/0, access_validator/0]).
-export([validator/1, validators/0]).
-export([loaded_shared_roster_module/1]).
%% gen_server callbacks
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
terminate/2, code_change/3]).

View File

@ -600,6 +600,23 @@ match([H|T1], [<<"%c">>|T2], U, S, R) ->
R -> match(T1, T2, U, S, R);
_ -> false
end;
match([H|T1], [<<"%g">>|T2], U, S, R) ->
case jid:resourceprep(H) of
H ->
case acl:loaded_shared_roster_module(S) of
undefined -> false;
Mod ->
case Mod:get_group_opts(S, H) of
error -> false;
_ ->
case Mod:is_user_in_group({U, S}, H, S) of
true -> match(T1, T2, U, S, R);
_ -> false
end
end
end;
_ -> false
end;
match([H|T1], [H|T2], U, S, R) ->
match(T1, T2, U, S, R);
match([], [], _, _, _) ->