25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-10 16:58:46 +01:00

Make JID related functions from jlib.erl deprecated

This commit is contained in:
Evgeniy Khramtsov 2015-11-24 20:24:43 +03:00
parent 95265dd3ad
commit 87fb5132be
4 changed files with 19 additions and 7 deletions

View File

@ -187,7 +187,7 @@ Config = [{erl_opts, Macros ++ HiPE ++ DebugInfo ++
++ TestConfig
++ "-include " ++ filename:join([Cwd, "tools"])},
{xref_warnings, false},
{xref_checks, []},
{xref_checks, [deprecated_function_calls]},
{xref_queries,
[{"(XC - UC) || (XU - X - B - "
++ string:join(CfgXrefs, " - ") ++ ")", []}]},

View File

@ -62,6 +62,18 @@
nameprep/1, resourceprep/1, jid_tolower/1,
jid_remove_resource/1, jid_replace_resource/2]).
-deprecated([{make_jid, '_'},
{split_jid, 1},
{string_to_jid, 1},
{jid_to_string, 1},
{is_nodename, 1},
{nodeprep, 1},
{nameprep, 1},
{resourceprep, 1},
{jid_tolower, 1},
{jid_remove_resource, 1},
{jid_replace_resource, 2}]).
-include("ejabberd.hrl").
-include("jlib.hrl").

View File

@ -2533,15 +2533,15 @@ dec_bool(<<"true">>) -> true;
dec_bool(<<"1">>) -> true.
resourceprep(R) ->
case jlib:resourceprep(R) of
case jid:resourceprep(R) of
error -> erlang:error(badarg);
R1 -> R1
end.
enc_jid(J) -> jlib:jid_to_string(J).
enc_jid(J) -> jid:to_string(J).
dec_jid(Val) ->
case jlib:string_to_jid(Val) of
case jid:from_string(Val) of
error -> erlang:error(badarg);
J -> J
end.

View File

@ -2421,7 +2421,7 @@ enc_utc(Val) ->
jlib:now_to_utc_string(Val).
dec_jid(Val) ->
case jlib:string_to_jid(Val) of
case jid:from_string(Val) of
error ->
erlang:error(badarg);
J ->
@ -2429,10 +2429,10 @@ dec_jid(Val) ->
end.
enc_jid(J) ->
jlib:jid_to_string(J).
jid:to_string(J).
resourceprep(R) ->
case jlib:resourceprep(R) of
case jid:resourceprep(R) of
error ->
erlang:error(badarg);
R1 ->