mirror of
https://github.com/processone/ejabberd
synced 2025-10-03 17:59:31 +02:00
Fix call to atom_to_binary/1 for Erlang/OTP older than 23
This commit is contained in:
parent
eceb9b729f
commit
f28e7b37bc
3 changed files with 5 additions and 2 deletions
|
@ -869,7 +869,7 @@ join_cluster_here(_Node, _IsNodes, true, _Ping) ->
|
||||||
join_cluster_here(_Node, _IsNodes, _IsKnownNodes, pang) ->
|
join_cluster_here(_Node, _IsNodes, _IsKnownNodes, pang) ->
|
||||||
{error, "This node cannot reach that node."};
|
{error, "This node cannot reach that node."};
|
||||||
join_cluster_here(Node, false, false, pong) ->
|
join_cluster_here(Node, false, false, pong) ->
|
||||||
case ejabberd_cluster:call(Node, ejabberd_admin, join_cluster, [atom_to_binary(node())]) of
|
case ejabberd_cluster:call(Node, ejabberd_admin, join_cluster, [misc:atom_to_binary(node())]) of
|
||||||
{ok, _} ->
|
{ok, _} ->
|
||||||
{ok, "Trying to join node to this cluster, wait a few seconds and check the list of nodes."};
|
{ok, "Trying to join node to this cluster, wait a few seconds and check the list of nodes."};
|
||||||
Error ->
|
Error ->
|
||||||
|
|
|
@ -1607,7 +1607,7 @@ make_login_items(#request{us = {Username, Host}} = R, Level) ->
|
||||||
?LI([?C(unicode:characters_to_binary("🏭")),
|
?LI([?C(unicode:characters_to_binary("🏭")),
|
||||||
make_command(echo,
|
make_command(echo,
|
||||||
R,
|
R,
|
||||||
[{<<"sentence">>, atom_to_binary(node())}],
|
[{<<"sentence">>, misc:atom_to_binary(node())}],
|
||||||
[{only, value},
|
[{only, value},
|
||||||
{result_links, [{sentence, node, Level, <<"">>}]}])]),
|
{result_links, [{sentence, node, Level, <<"">>}]}])]),
|
||||||
?LI([?C(unicode:characters_to_binary("📤")),
|
?LI([?C(unicode:characters_to_binary("📤")),
|
||||||
|
|
|
@ -316,6 +316,9 @@ binary_to_atom(Bin) ->
|
||||||
tuple_to_binary(T) ->
|
tuple_to_binary(T) ->
|
||||||
iolist_to_binary(tuple_to_list(T)).
|
iolist_to_binary(tuple_to_list(T)).
|
||||||
|
|
||||||
|
%% erlang:atom_to_binary/1 is available since OTP 23
|
||||||
|
%% https://www.erlang.org/doc/apps/erts/erlang#atom_to_binary/1
|
||||||
|
%% Let's use /2 for backwards compatibility.
|
||||||
atom_to_binary(A) ->
|
atom_to_binary(A) ->
|
||||||
erlang:atom_to_binary(A, utf8).
|
erlang:atom_to_binary(A, utf8).
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue