%%%===================================================================
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().
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
-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) ->
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()].
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) ->