Skip to content

Commit

Permalink
Resolving remarks from PR
Browse files Browse the repository at this point in the history
  • Loading branch information
Janusz Jakubiec authored and Janusz Jakubiec committed Oct 14, 2021
1 parent c579418 commit 926579c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/mod_last.erl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@

-export([config_metrics/1]).

-define(MOD_LAST_BACKEND, mod_last_backend).
-ignore_xref([
behaviour_info/1, on_presence_update/5, process_local_iq/4,
process_sm_iq/4, remove_user/3, session_cleanup/5, remove_domain/3
Expand All @@ -73,6 +72,7 @@
-type timestamp() :: non_neg_integer().
-type status() :: binary().

-spec start(mongooseim:host_type(), list()) -> 'ok'.
start(HostType, Opts) ->
IQDisc = gen_mod:get_opt(iqdisc, Opts, one_queue),

Expand Down
6 changes: 4 additions & 2 deletions src/mod_last_backend.erl
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,16 @@

-spec init(mod_last:host_type(), gen_mod:module_opts()) -> ok.
init(HostType, Opts) ->
TrackedFuns = [get_last, set_last_info],
mongoose_backend:init_per_host_type(HostType, ?MAIN_MODULE, TrackedFuns),
Args = [HostType, Opts],
mongoose_backend:call(HostType, ?MAIN_MODULE, ?FUNCTION_NAME, Args).

-spec get_last(mod_last:host_type(), jid:luser(), jid:lserver()) ->
{ok, mod_last:timestamp(), mod_last:status()} | {error, term()} | not_found.
get_last(HostType, LUser, LServer) ->
Args = [HostType, LUser, LServer],
mongoose_backend:call(HostType, ?MAIN_MODULE, ?FUNCTION_NAME, Args).
mongoose_backend:call_tracked(HostType, ?MAIN_MODULE, ?FUNCTION_NAME, Args).

-spec count_active_users(mod_last:host_type(), jid:lserver(), mod_last:timestamp()) ->
non_neg_integer().
Expand All @@ -57,7 +59,7 @@ count_active_users(HostType, LServer, Timestamp) ->
mod_last:status()) -> ok | {error, term()}.
set_last_info(HostType, LUser, LServer, Timestamp, Status) ->
Args = [HostType, LUser, LServer, Timestamp, Status],
mongoose_backend:call(HostType, ?MAIN_MODULE, ?FUNCTION_NAME, Args).
mongoose_backend:call_tracked(HostType, ?MAIN_MODULE, ?FUNCTION_NAME, Args).

-spec remove_user(mod_last:host_type(), jid:luser(), jid:lserver()) ->
ok | {error, term()}.
Expand Down

0 comments on commit 926579c

Please sign in to comment.