From c46fa1013c07b2cdc8a1f911f1e41d3fa4b4fcb8 Mon Sep 17 00:00:00 2001 From: Janusz Jakubiec Date: Tue, 19 Oct 2021 10:20:45 +0200 Subject: [PATCH] Removing xref to mod_last from rebar.config --- rebar.config | 2 +- src/mod_last.erl | 13 ++++++------- src/mod_last_backend.erl | 26 +++++++++++++------------- 3 files changed, 20 insertions(+), 21 deletions(-) diff --git a/rebar.config b/rebar.config index c659fac0c5..3d4cb89e11 100644 --- a/rebar.config +++ b/rebar.config @@ -24,7 +24,7 @@ mod_bosh_backend, mod_event_pusher_push_backend, mod_global_distrib_mapping_backend, mod_http_upload_backend, mod_inbox_backend, mod_keystore_backend, - mod_last_backend, mod_mam_cassandra_arch_params, + mod_mam_cassandra_arch_params, mod_mam_cassandra_prefs_params, mod_mam_muc_cassandra_arch_params, mod_muc_db_backend, mod_muc_light_codec_backend, mod_muc_light_db_backend, mod_offline_backend, diff --git a/src/mod_last.erl b/src/mod_last.erl index 6b6294a6cf..9eedea28bc 100644 --- a/src/mod_last.erl +++ b/src/mod_last.erl @@ -66,9 +66,8 @@ %% ------------------------------------------------------------------ %% Backend callbacks --export_type([host_type/0, timestamp/0, status/0]). +-export_type([timestamp/0, status/0]). --type host_type() :: mongooseim:host_type(). -type timestamp() :: non_neg_integer(). -type status() :: binary(). @@ -178,7 +177,7 @@ process_sm_iq(Acc, From, To, #iq{type = get, sub_el = SubEl} = IQ, _Extra) -> {Acc, IQ#iq{type = error, sub_el = [SubEl, mongoose_xmpp_errors:forbidden()]}} end. --spec make_response(host_type(), jlib:iq(), SubEl :: 'undefined' | [exml:element()], +-spec make_response(mongooseim:host_type(), jlib:iq(), SubEl :: 'undefined' | [exml:element()], jid:jid(), allow | deny) -> jlib:iq(). make_response(_HostType, IQ, SubEl, _, deny) -> IQ#iq{type = error, sub_el = [SubEl, mongoose_xmpp_errors:forbidden()]}; @@ -215,7 +214,7 @@ make_response(HostType, IQ, SubEl, JID, allow) -> children = []}]} end. --spec get_last_info(host_type(), jid:luser(), jid:lserver()) +-spec get_last_info(mongooseim:host_type(), jid:luser(), jid:lserver()) -> 'not_found' | {'ok', integer(), binary()}. get_last_info(HostType, LUser, LServer) -> case get_last(HostType, LUser, LServer) of @@ -255,7 +254,7 @@ store_last_info(Acc, LUser, LServer, Status) -> store_last_info(HostType, LUser, LServer, TimeStamp, Status), Acc. --spec store_last_info(host_type(), jid:luser(), jid:lserver(), timestamp(), status()) -> ok. +-spec store_last_info(mongooseim:host_type(), jid:luser(), jid:lserver(), timestamp(), status()) -> ok. store_last_info(HostType, LUser, LServer, TimeStamp, Status) -> case mod_last_backend:set_last_info(HostType, LUser, LServer, TimeStamp, Status) of {error, Reason} -> @@ -268,12 +267,12 @@ store_last_info(HostType, LUser, LServer, TimeStamp, Status) -> ok end. --spec get_last(host_type(), jid:luser(), jid:lserver()) -> +-spec get_last(mongooseim:host_type(), jid:luser(), jid:lserver()) -> {ok, timestamp(), status()} | {error, term()} | not_found. get_last(HostType, LUser, LServer) -> mod_last_backend:get_last(HostType, LUser, LServer). --spec count_active_users(host_type(), jid:lserver(), timestamp()) -> non_neg_integer(). +-spec count_active_users(mongooseim:host_type(), jid:lserver(), timestamp()) -> non_neg_integer(). count_active_users(HostType, LServer, Timestamp) -> mod_last_backend:count_active_users(HostType, LServer, Timestamp). diff --git a/src/mod_last_backend.erl b/src/mod_last_backend.erl index 38b0d637d9..91a7ef52bc 100644 --- a/src/mod_last_backend.erl +++ b/src/mod_last_backend.erl @@ -11,48 +11,48 @@ -define(MAIN_MODULE, mod_last). --callback init(mod_last:host_type(), gen_mod:module_opts()) -> ok. +-callback init(mongooseim:host_type(), gen_mod:module_opts()) -> ok. --callback get_last(mod_last:host_type(), jid:luser(), jid:lserver()) -> +-callback get_last(mongooseim:host_type(), jid:luser(), jid:lserver()) -> {ok, mod_last:timestamp(), mod_last:status()} | {error, term()} | not_found. --callback count_active_users(mod_last:host_type(), jid:lserver(), mod_last:timestamp()) -> +-callback count_active_users(mongooseim:host_type(), jid:lserver(), mod_last:timestamp()) -> non_neg_integer(). -callback set_last_info( - mod_last:host_type(), + mongooseim:host_type(), jid:luser(), jid:lserver(), mod_last:timestamp(), mod_last:status()) -> ok | {error, term()}. --callback remove_user(mod_last:host_type(), jid:luser(), jid:lserver()) -> +-callback remove_user(mongooseim:host_type(), jid:luser(), jid:lserver()) -> ok | {error, term()}. --callback remove_domain(mod_last:host_type(), jid:lserver()) -> +-callback remove_domain(mongooseim:host_type(), jid:lserver()) -> ok | {error, term()}. --spec init(mod_last:host_type(), gen_mod:module_opts()) -> ok. +-spec init(mongooseim: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, Opts), Args = [HostType, Opts], mongoose_backend:call(HostType, ?MAIN_MODULE, ?FUNCTION_NAME, Args). --spec get_last(mod_last:host_type(), jid:luser(), jid:lserver()) -> +-spec get_last(mongooseim: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_tracked(HostType, ?MAIN_MODULE, ?FUNCTION_NAME, Args). --spec count_active_users(mod_last:host_type(), jid:lserver(), mod_last:timestamp()) -> +-spec count_active_users(mongooseim:host_type(), jid:lserver(), mod_last:timestamp()) -> non_neg_integer(). count_active_users(HostType, LServer, Timestamp) -> Args = [HostType, LServer, Timestamp], mongoose_backend:call(HostType, ?MAIN_MODULE, ?FUNCTION_NAME, Args). -spec set_last_info( - mod_last:host_type(), + mongooseim:host_type(), jid:luser(), jid:lserver(), mod_last:timestamp(), @@ -61,14 +61,14 @@ set_last_info(HostType, LUser, LServer, Timestamp, Status) -> Args = [HostType, LUser, LServer, Timestamp, Status], mongoose_backend:call_tracked(HostType, ?MAIN_MODULE, ?FUNCTION_NAME, Args). --spec remove_user(mod_last:host_type(), jid:luser(), jid:lserver()) -> +-spec remove_user(mongooseim:host_type(), jid:luser(), jid:lserver()) -> ok | {error, term()}. remove_user(HostType, LUser, LServer) -> Args = [HostType, LUser, LServer], mongoose_backend:call(HostType, ?MAIN_MODULE, ?FUNCTION_NAME, Args). --spec remove_domain(mod_last:host_type(), jid:lserver()) -> +-spec remove_domain(mongooseim:host_type(), jid:lserver()) -> ok | {error, term()}. remove_domain(HostType, LServer) -> Args = [HostType, LServer], - mongoose_backend:call(HostType, ?MAIN_MODULE, ?FUNCTION_NAME, Args). \ No newline at end of file + mongoose_backend:call(HostType, ?MAIN_MODULE, ?FUNCTION_NAME, Args).