Support static_modules in mod_blocking, configure, pres_counter, register, shared_roster and sic

This commit is contained in:
Badlop 2011-07-15 02:49:48 +02:00
parent 86859e5234
commit 12d6f3364b
6 changed files with 18 additions and 12 deletions

View File

@ -38,8 +38,9 @@
-include_lib("exmpp/include/exmpp.hrl").
-include("mod_privacy.hrl").
start(Host, Opts) ->
HostB = list_to_binary(Host),
start(Host, Opts) when is_list(Host) ->
start(list_to_binary(Host), Opts);
start(HostB, Opts) ->
IQDisc = gen_mod:get_opt(iqdisc, Opts, one_queue),
ejabberd_hooks:add(privacy_iq_get, HostB,
?MODULE, process_iq_get, 40),

View File

@ -56,8 +56,9 @@
%% Copied from ejabberd_sm.erl
-record(session, {sid, usr, us, priority, info}).
start(Host, _Opts) ->
HostB = list_to_binary(Host),
start(Host, Opts) when is_list(Host) ->
start(list_to_binary(Host), Opts);
start(HostB, _Opts) ->
ejabberd_hooks:add(disco_local_items, HostB, ?MODULE, get_local_items, 50),
ejabberd_hooks:add(disco_local_features, HostB, ?MODULE, get_local_features, 50),
ejabberd_hooks:add(disco_local_identity, HostB, ?MODULE, get_local_identity, 50),

View File

@ -37,8 +37,9 @@
-record(pres_counter, {dir, start, count, logged = false}).
start(Host, _Opts) ->
HostB = list_to_binary(Host),
start(Host, Opts) when is_list(Host) ->
start(list_to_binary(Host), Opts);
start(HostB, _Opts) ->
ejabberd_hooks:add(privacy_check_packet, HostB,
?MODULE, check_packet, 25),
ok.

View File

@ -40,8 +40,9 @@
-include("ejabberd.hrl").
start(Host, Opts) ->
HostB = list_to_binary(Host),
start(Host, Opts) when is_list(Host) ->
start(list_to_binary(Host), Opts);
start(HostB, Opts) ->
IQDisc = gen_mod:get_opt(iqdisc, Opts, one_queue),
gen_iq_handler:add_iq_handler(ejabberd_local, HostB, ?NS_INBAND_REGISTER,
?MODULE, process_iq, IQDisc),

View File

@ -63,8 +63,9 @@
-record(sr_group, {group_host, opts}).
-record(sr_user, {us, group_host}).
start(Host, _Opts) ->
HostB = list_to_binary(Host),
start(Host, Opts) when is_list(Host) ->
start(list_to_binary(Host), Opts);
start(HostB, _Opts) ->
mnesia:create_table(sr_group,
[{disc_copies, [node()]},
{attributes, record_info(fields, sr_group)}]),

View File

@ -38,8 +38,9 @@
-include_lib("exmpp/include/exmpp_jid.hrl").
-include("ejabberd.hrl").
start(Host, Opts) ->
HostB = list_to_binary(Host),
start(Host, Opts) when is_list(Host) ->
start(list_to_binary(Host), Opts);
start(HostB, Opts) ->
IQDisc = gen_mod:get_opt(iqdisc, Opts, one_queue),
mod_disco:register_feature(HostB, ?NS_SIC_0_s),
gen_iq_handler:add_iq_handler(ejabberd_local, HostB, ?NS_SIC_0_s,