[named_table, public, {read_concurrency, true}]),
catch ets:new(ejabberd_db_modules,
[named_table, public, {read_concurrency, true}]),
- set_opts(set_hosts_in_options(Hosts, #state{opts = Opts})),
+ UnixTime = p1_time_compat:system_time(seconds),
+ SharedKey = case erlang:get_cookie() of
+ nocookie ->
+ str:sha(randoms:get_string());
+ Cookie ->
+ str:sha(misc:atom_to_binary(Cookie))
+ end,
+ State1 = #state{opts = Opts},
+ State2 = set_option({node_start, global}, UnixTime, State1),
+ State3 = set_option({shared_key, global}, SharedKey, State2),
+ set_opts(set_hosts_in_options(Hosts, State3)),
ok.
%% @doc Get the filename of the ejabberd configuration file.
-spec get_myhosts() -> [binary()].
get_myhosts() ->
- case get_option(hosts) of
- V when is_list(V) ->
- V;
- _ ->
- []
- end.
+ get_option(hosts).
-spec get_mylang() -> binary().
:acl.start_link
:ejabberd_access_permissions.start_link()
:ejabberd_commands.start_link
- :ok = :ejabberd_config.start([@domain], [])
- :gen_mod.start_link
+ :ok = :ejabberd_config.start(["domain"], [])
+ :gen_mod.start_link
:mod_admin_extra.start(@domain, [])
:sel_application.start_app(:moka)
:ejabberd_hooks.start_link