mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-22 17:28:25 +01:00
Use list_to_existing_atom/1 wherever possible
This commit is contained in:
parent
31050f5b09
commit
e84391a6a9
@ -194,7 +194,7 @@ code_change(_OldVsn, State, _Extra) ->
|
||||
%%%===================================================================
|
||||
get_mod() ->
|
||||
Backend = ejabberd_option:cluster_backend(),
|
||||
list_to_atom("ejabberd_cluster_" ++ atom_to_list(Backend)).
|
||||
list_to_existing_atom("ejabberd_cluster_" ++ atom_to_list(Backend)).
|
||||
|
||||
rpc_timeout() ->
|
||||
ejabberd_option:rpc_timeout().
|
||||
|
@ -565,7 +565,7 @@ process(_Handlers, _Request) ->
|
||||
|
||||
get_db_backend() ->
|
||||
DBType = ejabberd_option:oauth_db_type(),
|
||||
list_to_atom("ejabberd_oauth_" ++ atom_to_list(DBType)).
|
||||
list_to_existing_atom("ejabberd_oauth_" ++ atom_to_list(DBType)).
|
||||
|
||||
|
||||
%% Headers as per RFC 6749
|
||||
|
@ -429,7 +429,7 @@ get_domain_balancing(From, To, LDomain) ->
|
||||
-spec get_backend() -> module().
|
||||
get_backend() ->
|
||||
DBType = ejabberd_option:router_db_type(),
|
||||
list_to_atom("ejabberd_router_" ++ atom_to_list(DBType)).
|
||||
list_to_existing_atom("ejabberd_router_" ++ atom_to_list(DBType)).
|
||||
|
||||
-spec cache_nodes(module()) -> [node()].
|
||||
cache_nodes(Mod) ->
|
||||
|
@ -881,7 +881,7 @@ force_update_presence({LUser, LServer}) ->
|
||||
|
||||
get_sm_backend(Host) ->
|
||||
DBType = ejabberd_option:sm_db_type(Host),
|
||||
list_to_atom("ejabberd_sm_" ++ atom_to_list(DBType)).
|
||||
list_to_existing_atom("ejabberd_sm_" ++ atom_to_list(DBType)).
|
||||
|
||||
-spec get_sm_backends() -> [module()].
|
||||
|
||||
|
@ -353,7 +353,7 @@ db_mod(Opt, Host, Module) when is_binary(Host) orelse Host == global ->
|
||||
db_mod(Opt, Opts, Module) when is_map(Opts) ->
|
||||
db_mod(Opt, get_opt(Opt, Opts), Module);
|
||||
db_mod(_Opt, Type, Module) when is_atom(Type) ->
|
||||
list_to_atom(atom_to_list(Module) ++ "_" ++ atom_to_list(Type)).
|
||||
list_to_existing_atom(atom_to_list(Module) ++ "_" ++ atom_to_list(Type)).
|
||||
|
||||
-spec loaded_modules(binary()) -> [atom()].
|
||||
loaded_modules(Host) ->
|
||||
|
Loading…
Reference in New Issue
Block a user