Skip to content

Commit

Permalink
Update config_metrics callbacks in modules already using maps
Browse files Browse the repository at this point in the history
  • Loading branch information
chrzaszcz committed Mar 29, 2022
1 parent a3e1820 commit ffc4515
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/mod_muc.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1370,9 +1370,9 @@ ensure_metrics(_Host) ->
{function, mod_muc, online_rooms_number, [],
eval, ?EX_EVAL_SINGLE_VALUE}).

-spec config_metrics(mongooseim:host_type()) -> [{gen_mod:opt_key(), gen_mod:opt_value()}].
config_metrics(HostType) ->
OptsToReport = [{backend, mnesia}], %list of tuples {option, defualt_value}
mongoose_module_metrics:opts_for_module(HostType, ?MODULE, OptsToReport).
mongoose_module_metrics:opts_for_module(HostType, ?MODULE, [backend]).

hooks(HostType) ->
[{is_muc_room_owner, HostType, ?MODULE, is_muc_room_owner, 50},
Expand Down
6 changes: 3 additions & 3 deletions src/mod_private.erl
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,6 @@ is_valid_namespace(Namespace) -> Namespace =/= <<>>.
error_iq(IQ=#iq{sub_el=SubElem}, ErrorStanza) ->
IQ#iq{type = error, sub_el = [SubElem, ErrorStanza]}.

config_metrics(Host) ->
OptsToReport = [{backend, mnesia}], %list of tuples {option, defualt_value}
mongoose_module_metrics:opts_for_module(Host, ?MODULE, OptsToReport).
-spec config_metrics(mongooseim:host_type()) -> [{gen_mod:opt_key(), gen_mod:opt_value()}].
config_metrics(HostType) ->
mongoose_module_metrics:opts_for_module(HostType, ?MODULE, [backend]).
6 changes: 3 additions & 3 deletions src/muc_light/mod_muc_light.erl
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,6 @@ maybe_forget_rooms(Acc, [{RoomUS, {ok, _, NewAffUsers, _, _}} | RAffectedRooms],
make_handler_fun(Acc) ->
fun(From, To, Packet) -> ejabberd_router:route(From, To, Acc, Packet) end.

config_metrics(Host) ->
OptsToReport = [{backend, mnesia}], %list of tuples {option, defualt_value}
mongoose_module_metrics:opts_for_module(Host, ?MODULE, OptsToReport).
-spec config_metrics(mongooseim:host_type()) -> [{gen_mod:opt_key(), gen_mod:opt_value()}].
config_metrics(HostType) ->
mongoose_module_metrics:opts_for_module(HostType, ?MODULE, [backend]).
4 changes: 2 additions & 2 deletions src/privacy/mod_privacy.erl
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,6 @@ broadcast_privacy_list_packet(Name, UserList) ->
roster_get_jid_info(HostType, ToJID, LJID) ->
mongoose_hooks:roster_get_jid_info(HostType, ToJID, LJID).

-spec config_metrics(mongooseim:host_type()) -> [{gen_mod:opt_key(), gen_mod:opt_value()}].
config_metrics(HostType) ->
OptsToReport = [{backend, mnesia}], %list of tuples {option, defualt_value}
mongoose_module_metrics:opts_for_module(HostType, ?MODULE, OptsToReport).
mongoose_module_metrics:opts_for_module(HostType, ?MODULE, [backend]).

0 comments on commit ffc4515

Please sign in to comment.