24
1
mirror of https://github.com/processone/ejabberd.git synced 2024-06-10 21:47:01 +02:00

API renaming : jid_to_list -> to_list

SVN Revision: 2131
This commit is contained in:
Karim Gemayel 2009-06-01 16:52:14 +00:00
parent 1b94c7a8b3
commit 15bc238297
19 changed files with 36 additions and 36 deletions

View File

@ -59,7 +59,7 @@ create_captcha(Id, SID, From, To, Lang, Args)
case create_image() of
{ok, Type, Key, Image} ->
B64Image = jlib:encode_base64(binary_to_list(Image)),
JID = exmpp_jid:jid_to_list(From),
JID = exmpp_jid:to_list(From),
CID = "sha1+" ++ sha:sha(Image) ++ "@bob.xmpp.org",
Data = {xmlelement, "data",
[{"xmlns", ?NS_BOB}, {"cid", CID},
@ -70,7 +70,7 @@ create_captcha(Id, SID, From, To, Lang, Args)
%% ?NS_DATA_FORMS is 'jabber:x:data'
[{xmlelement, "x", [{"xmlns", "jabber:x:data"}, {"type", "form"}],
[?VFIELD("hidden", "FORM_TYPE", {xmlcdata, ?NS_CAPTCHA}),
?VFIELD("hidden", "from", {xmlcdata, exmpp_jid:jid_to_list(To)}),
?VFIELD("hidden", "from", {xmlcdata, exmpp_jid:to_list(To)}),
?VFIELD("hidden", "challenge", {xmlcdata, Id}),
?VFIELD("hidden", "sid", {xmlcdata, SID}),
{xmlelement, "field", [{"var", "ocr"}, {"label", ?CAPTCHA_TEXT(Lang)}],

View File

@ -92,7 +92,7 @@ export_roster(Server, Output) ->
fun(Host, #roster{usj = {LUser, LServer, {N, D, Res} = _LJID}} = R)
when LServer == Host ->
Username = ejabberd_odbc:escape(LUser),
SJID = ejabberd_odbc:escape(exmpp_jid:jid_to_list(N, D, Res)),
SJID = ejabberd_odbc:escape(exmpp_jid:to_list(N, D, Res)),
ItemVals = record_to_string(R),
ItemGroups = groups_to_string(R),
["delete from rosterusers "
@ -125,8 +125,8 @@ export_offline(Server, Output) ->
when LServer == Host ->
Username = ejabberd_odbc:escape(LUser),
Packet0 = exmpp_stanza:set_jids(Packet,
exmpp_jid:jid_to_list(From),
exmpp_jid:jid_to_list(To)),
exmpp_jid:to_list(From),
exmpp_jid:to_list(To)),
Packet1 = exmpp_xml:append_child(Packet0,
jlib:timestamp_to_xml(
calendar:now_to_universal_time(TimeStamp))),
@ -313,7 +313,7 @@ record_to_string(#roster{usj = {User, _Server, {N, D, R} = _JID},
ask = Ask,
askmessage = AskMessage}) ->
Username = ejabberd_odbc:escape(User),
SJID = ejabberd_odbc:escape(exmpp_jid:jid_to_list(N, D, R)),
SJID = ejabberd_odbc:escape(exmpp_jid:to_list(N, D, R)),
Nick = ejabberd_odbc:escape(Name),
SSubscription = case Subscription of
both -> "B";
@ -349,7 +349,7 @@ record_to_string(#roster{usj = {User, _Server, {N, D, R} = _JID},
groups_to_string(#roster{usj = {User, _Server, {N, D, R} = _JID},
groups = Groups}) ->
Username = ejabberd_odbc:escape(User),
SJID = ejabberd_odbc:escape(exmpp_jid:jid_to_list(N, D, R)),
SJID = ejabberd_odbc:escape(exmpp_jid:to_list(N, D, R)),
[["("
"'", Username, "',"
"'", SJID, "',"

View File

@ -390,7 +390,7 @@ handle_cast({disco_response, From, _To, #iq{id = ID, type = Type, payload = Payl
?DEBUG("ID '~s' matches no query", [ID])
end;
%gen_server:cast(self(), visit_feature_queries),
%?DEBUG("Error IQ reponse from ~s:~n~p", [exmpp_jid:jid_to_list(From), SubEls]);
%?DEBUG("Error IQ reponse from ~s:~n~p", [exmpp_jid:to_list(From), SubEls]);
{result, Payload} ->
?DEBUG("Invalid IQ contents from ~s:~n~p", [exmpp_jid:jid_to_binary(From), Payload]);
_ ->

View File

@ -871,7 +871,7 @@ process_userinfo(StateData, _Nick, From) ->
"xmpp:~s"
"\001\r\n",
[FromUser,
exmpp_jid:jid_to_list(StateData#state.user)])).
exmpp_jid:to_list(StateData#state.user)])).
process_topic(StateData, Chan, From, String) ->

View File

@ -795,7 +795,7 @@ get_room_info(RoomJID, Opts) ->
{value, {_, SA}} -> SA;
false -> ""
end,
#room{jid = exmpp_jid:jid_to_list(RoomJID),
#room{jid = exmpp_jid:to_list(RoomJID),
title = Title,
subject = Subject,
subject_author = SubjectAuthor,

View File

@ -2825,7 +2825,7 @@ get_config(Lang, StateData, From) ->
Res =
[#xmlel{name = 'title', children = [ #xmlcdata{cdata =
io_lib:format(translate:translate(Lang, "Configuration of room ~s"),
[exmpp_jid:jid_to_list(StateData#state.jid)])
[exmpp_jid:to_list(StateData#state.jid)])
}]},
#xmlel{name = 'field', attrs = [?XMLATTR('type', <<"hidden">>),
?XMLATTR('var', <<"FORM_TYPE">>)],

View File

@ -567,8 +567,8 @@ user_queue(User, Server, Query, Lang) ->
io_lib:format(
"~w-~.2.0w-~.2.0w ~.2.0w:~.2.0w:~.2.0w",
[Year, Month, Day, Hour, Minute, Second])),
SFrom = exmpp_jid:jid_to_list(From),
STo = exmpp_jid:jid_to_list(To),
SFrom = exmpp_jid:to_list(From),
STo = exmpp_jid:to_list(To),
Packet1 = exmpp_stanza:set_jids(Packet, SFrom, STo),
FPacket = exmpp_xml:node_to_list(
exmpp_xml:indent_document(Packet1, <<" ">>),
@ -636,7 +636,7 @@ user_queue_parse_query(US, Query) ->
end.
us_to_list({User, Server}) ->
exmpp_jid:jid_to_list(User, Server).
exmpp_jid:to_list(User, Server).
webadmin_user(Acc, User, Server, Lang) ->
FQueueLen = try

View File

@ -440,7 +440,7 @@ user_queue_parse_query(Username, LServer, Query) ->
end.
us_to_list({User, Server}) ->
exmpp_jid:jid_to_list(User, Server).
exmpp_jid:to_list(User, Server).
webadmin_user(Acc, User, Server, Lang) ->
FQueueLen = try

View File

@ -747,7 +747,7 @@ item_to_raw(#listitem{type = Type,
{"n", ""};
jid ->
{N0, D0, R0} = Value,
{"j", exmpp_jid:jid_to_list(N0, D0, R0)};
{"j", exmpp_jid:to_list(N0, D0, R0)};
group ->
{"g", Value};
subscription ->

View File

@ -123,8 +123,8 @@ activate({P1, J1}, {P2, J2}) ->
{S1, S2} when is_port(S1), is_port(S2) ->
P1 ! {activate, P2, S2, J1, J2},
P2 ! {activate, P1, S1, J1, J2},
JID1 = exmpp_jid:jid_to_list(J1),
JID2 = exmpp_jid:jid_to_list(J2),
JID1 = exmpp_jid:to_list(J1),
JID2 = exmpp_jid:to_list(J2),
?INFO_MSG("(~w:~w) Activated bytestream for ~s -> ~s", [P1, P2, JID1, JID2]),
ok;
_ ->

View File

@ -2777,8 +2777,8 @@ max_items(Options) ->
-define(JLIST_CONFIG_FIELD(Label, Var, Opts),
?LISTXFIELD(Label, "pubsub#" ++ atom_to_list(Var),
exmpp_jid:jid_to_list(get_option(Options, Var)),
[exmpp_jid:jid_to_list(O) || O <- Opts])).
exmpp_jid:to_list(get_option(Options, Var)),
[exmpp_jid:to_list(O) || O <- Opts])).
-define(ALIST_CONFIG_FIELD(Label, Var, Opts),
?LISTXFIELD(Label, "pubsub#" ++ atom_to_list(Var),

View File

@ -262,7 +262,7 @@ send_registration_notifications(UJID) ->
Body = lists:flatten(
io_lib:format(
"The user '~s' was just created on node ~w.",
[exmpp_jid:jid_to_list(UJID), node()])),
[exmpp_jid:to_list(UJID), node()])),
lists:foreach(
fun(S) ->
try

View File

@ -1197,9 +1197,9 @@ build_contact_jid_td({U, S, R}) ->
end,
case JIDURI of
[] ->
?XAC('td', [?XMLATTR('class', <<"valign">>)], exmpp_jid:jid_to_list(ContactJID));
?XAC('td', [?XMLATTR('class', <<"valign">>)], exmpp_jid:to_list(ContactJID));
URI when is_list(URI) ->
?XAE('td', [?XMLATTR('class', <<"valign">>)], [?AC(JIDURI, exmpp_jid:jid_to_list(ContactJID))])
?XAE('td', [?XMLATTR('class', <<"valign">>)], [?AC(JIDURI, exmpp_jid:to_list(ContactJID))])
end.
%% @spec (User, Server, Items, Query) -> ok | nothing | error
@ -1277,7 +1277,7 @@ user_roster_item_parse_query(User, Server, Items, Query) ->
{U, S, R} = JID,
UJID = exmpp_jid:make(User, Server),
Attrs1 = exmpp_xml:set_attribute_in_list([],
'jid', exmpp_jid:jid_to_list(U, S, R)),
'jid', exmpp_jid:to_list(U, S, R)),
Attrs2 = exmpp_xml:set_attribute_in_list(Attrs1,
'subscription', "remove"),
Item = #xmlel{ns = ?NS_ROSTER, name = 'item',

View File

@ -1032,9 +1032,9 @@ build_contact_jid_td({U, S, R}) ->
end,
case JIDURI of
[] ->
?XAC('td', [?XMLATTR('class', <<"valign">>)], exmpp_jid:jid_to_list(ContactJID));
?XAC('td', [?XMLATTR('class', <<"valign">>)], exmpp_jid:to_list(ContactJID));
URI when is_list(URI) ->
?XAE('td', [?XMLATTR('class', <<"valign">>)], [?AC(JIDURI, exmpp_jid:jid_to_list(ContactJID))])
?XAE('td', [?XMLATTR('class', <<"valign">>)], [?AC(JIDURI, exmpp_jid:to_list(ContactJID))])
end.
user_roster_parse_query(User, Server, Items, Query) ->
@ -1095,7 +1095,7 @@ user_roster_item_parse_query(User, Server, Items, Query) ->
{value, _} ->
UJID = exmpp_jid:make(User, Server),
Attrs1 = exmpp_xml:set_attribute_in_list([],
'jid', exmpp_jid:jid_to_list(JID)),
'jid', exmpp_jid:to_list(JID)),
Attrs2 = exmpp_xml:set_attribute_in_list(Attrs1,
'subscription', "remove"),
Item = #xmlel{ns = ?NS_ROSTER, name = 'item',

View File

@ -712,7 +712,7 @@ push_roster_item(User, Server, ContactU, ContactS, GroupName, Subscription) ->
item_to_xml(Item) ->
{U, S, R} = Item#roster.jid,
Attrs1 = exmpp_xml:set_attribute_in_list([],
'jid', exmpp_jid:jid_to_list(U, S, R)),
'jid', exmpp_jid:to_list(U, S, R)),
Attrs2 = case Item#roster.name of
"" ->
Attrs1;

View File

@ -286,7 +286,7 @@ set_vcard(User, LServer, VCARD) ->
#xmlel{ns = ?NS_DATA_FORMS, name = 'x', attrs =
[?XMLATTR('type', <<"form">>)], children =
[#xmlel{ns = ?NS_DATA_FORMS, name = 'title', children =
[#xmlcdata{cdata = list_to_binary(translate:translate(Lang, "Search users in ") ++ exmpp_jid:jid_to_list(JID))}]},
[#xmlcdata{cdata = list_to_binary(translate:translate(Lang, "Search users in ") ++ exmpp_jid:to_list(JID))}]},
#xmlel{ns = ?NS_SEARCH, name = 'instructions', children =
[#xmlcdata{cdata = list_to_binary(translate:translate(Lang,
"Fill in the form to search "
@ -441,7 +441,7 @@ search_result(Lang, JID, ServerHost, Data) ->
[#xmlel{ns = ?NS_DATA_FORMS, name = 'title', children =
[#xmlcdata{cdata = list_to_binary(
translate:translate(Lang, "Search Results for ") ++
exmpp_jid:jid_to_list(JID))}]},
exmpp_jid:to_list(JID))}]},
#xmlel{ns = ?NS_DATA_FORMS, name = 'reported', children =
[?TLFIELD(<<"text-single">>, "Jabber ID", <<"jid">>),
?TLFIELD(<<"text-single">>, "Full Name", <<"fn">>),

View File

@ -398,7 +398,7 @@ ldap_attribute_to_vcard(_, _) ->
[?XMLATTR('type', <<"form">>)], children =
[#xmlel{ns = ?NS_DATA_FORMS, name = 'title', children =
[#xmlcdata{cdata = list_to_binary(translate:translate(Lang, "Search users in ") ++
exmpp_jid:jid_to_list(JID))}]},
exmpp_jid:to_list(JID))}]},
#xmlel{ns = ?NS_SEARCH, name = 'instructions', children =
[#xmlcdata{cdata = list_to_binary(translate:translate(Lang, "Fill in fields to search "
"for any matching Jabber User"))}]}
@ -525,7 +525,7 @@ search_result(Lang, JID, State, Data) ->
SearchReported = State#state.search_reported,
Header = [#xmlel{ns = ?NS_DATA_FORMS, name = 'title', children =
[#xmlcdata{cdata = list_to_binary(translate:translate(Lang, "Search Results for ") ++
exmpp_jid:jid_to_list(JID))}]},
exmpp_jid:to_list(JID))}]},
#xmlel{ns = ?NS_DATA_FORMS, name = 'reported', children =
[?TLFIELD(<<"text-single">>, "Jabber ID", <<"jid">>)] ++
lists:map(

View File

@ -260,7 +260,7 @@ set_vcard(User, LServer, VCARD) ->
#xmlel{ns = ?NS_DATA_FORMS, name = 'x', attrs =
[?XMLATTR('type', <<"form">>)], children =
[#xmlel{ns = ?NS_DATA_FORMS, name = 'title', children =
[#xmlcdata{cdata = list_to_binary(translate:translate(Lang, "Search users in ") ++ exmpp_jid:jid_to_list(JID))}]},
[#xmlcdata{cdata = list_to_binary(translate:translate(Lang, "Search users in ") ++ exmpp_jid:to_list(JID))}]},
#xmlel{ns = ?NS_SEARCH, name = 'instructions', children =
[#xmlcdata{cdata = list_to_binary(translate:translate(Lang,
"Fill in the form to search "
@ -405,7 +405,7 @@ search_result(Lang, JID, ServerHost, Data) ->
[#xmlel{ns = ?NS_DATA_FORMS, name = 'title', children =
[#xmlcdata{cdata = list_to_binary(
translate:translate(Lang, "Search Results for ") ++
exmpp_jid:jid_to_list(JID))}]},
exmpp_jid:to_list(JID))}]},
#xmlel{ns = ?NS_DATA_FORMS, name = 'reported', children =
[?TLFIELD(<<"text-single">>, "Jabber ID", <<"jid">>),
?TLFIELD(<<"text-single">>, "Full Name", <<"fn">>),

View File

@ -1483,10 +1483,10 @@ list_given_users(Users, Prefix, Lang, URLFunc) ->
)]).
us_to_list({User, Server}) ->
exmpp_jid:jid_to_list(User, Server, undefined).
exmpp_jid:to_list(User, Server, undefined).
su_to_list({Server, User}) ->
exmpp_jid:jid_to_list(User, Server, undefined).
exmpp_jid:to_list(User, Server, undefined).
get_stats(global, Lang) ->