From 15bc238297684d4b32fdde4ac8155c7f67083f7e Mon Sep 17 00:00:00 2001 From: Karim Gemayel Date: Mon, 1 Jun 2009 16:52:14 +0000 Subject: [PATCH] API renaming : jid_to_list -> to_list SVN Revision: 2131 --- src/ejabberd_captcha.erl | 4 ++-- src/ejd2odbc.erl | 10 +++++----- src/mod_caps.erl | 2 +- src/mod_irc/mod_irc_connection.erl | 2 +- src/mod_muc/mod_muc_log.erl | 2 +- src/mod_muc/mod_muc_room.erl | 2 +- src/mod_offline.erl | 6 +++--- src/mod_offline_odbc.erl | 2 +- src/mod_privacy_odbc.erl | 2 +- src/mod_proxy65/mod_proxy65_stream.erl | 4 ++-- src/mod_pubsub/mod_pubsub.erl | 4 ++-- src/mod_register.erl | 2 +- src/mod_roster.erl | 6 +++--- src/mod_roster_odbc.erl | 6 +++--- src/mod_shared_roster.erl | 2 +- src/mod_vcard.erl | 4 ++-- src/mod_vcard_ldap.erl | 4 ++-- src/mod_vcard_odbc.erl | 4 ++-- src/web/ejabberd_web_admin.erl | 4 ++-- 19 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/ejabberd_captcha.erl b/src/ejabberd_captcha.erl index 8813d82d2..68c91fe69 100644 --- a/src/ejabberd_captcha.erl +++ b/src/ejabberd_captcha.erl @@ -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)}], diff --git a/src/ejd2odbc.erl b/src/ejd2odbc.erl index 86850a49d..f46b45eba 100644 --- a/src/ejd2odbc.erl +++ b/src/ejd2odbc.erl @@ -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, "'," diff --git a/src/mod_caps.erl b/src/mod_caps.erl index 1c90dc2e8..fa872ec3f 100644 --- a/src/mod_caps.erl +++ b/src/mod_caps.erl @@ -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]); _ -> diff --git a/src/mod_irc/mod_irc_connection.erl b/src/mod_irc/mod_irc_connection.erl index 79d492ef6..afcb91aa4 100644 --- a/src/mod_irc/mod_irc_connection.erl +++ b/src/mod_irc/mod_irc_connection.erl @@ -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) -> diff --git a/src/mod_muc/mod_muc_log.erl b/src/mod_muc/mod_muc_log.erl index 7a582e739..f6d1d2ace 100644 --- a/src/mod_muc/mod_muc_log.erl +++ b/src/mod_muc/mod_muc_log.erl @@ -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, diff --git a/src/mod_muc/mod_muc_room.erl b/src/mod_muc/mod_muc_room.erl index a50f08cdd..8d1fdbfdc 100644 --- a/src/mod_muc/mod_muc_room.erl +++ b/src/mod_muc/mod_muc_room.erl @@ -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">>)], diff --git a/src/mod_offline.erl b/src/mod_offline.erl index 03217aede..bb9ce561a 100644 --- a/src/mod_offline.erl +++ b/src/mod_offline.erl @@ -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 diff --git a/src/mod_offline_odbc.erl b/src/mod_offline_odbc.erl index d71b3d726..7b3603f01 100644 --- a/src/mod_offline_odbc.erl +++ b/src/mod_offline_odbc.erl @@ -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 diff --git a/src/mod_privacy_odbc.erl b/src/mod_privacy_odbc.erl index aa1c0fedb..3e86dc794 100644 --- a/src/mod_privacy_odbc.erl +++ b/src/mod_privacy_odbc.erl @@ -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 -> diff --git a/src/mod_proxy65/mod_proxy65_stream.erl b/src/mod_proxy65/mod_proxy65_stream.erl index 29f55c188..f8b421bbf 100644 --- a/src/mod_proxy65/mod_proxy65_stream.erl +++ b/src/mod_proxy65/mod_proxy65_stream.erl @@ -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; _ -> diff --git a/src/mod_pubsub/mod_pubsub.erl b/src/mod_pubsub/mod_pubsub.erl index b22501295..9cae8b368 100644 --- a/src/mod_pubsub/mod_pubsub.erl +++ b/src/mod_pubsub/mod_pubsub.erl @@ -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), diff --git a/src/mod_register.erl b/src/mod_register.erl index 218abdad5..d521369bd 100644 --- a/src/mod_register.erl +++ b/src/mod_register.erl @@ -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 diff --git a/src/mod_roster.erl b/src/mod_roster.erl index d320ce64e..e73a557b5 100644 --- a/src/mod_roster.erl +++ b/src/mod_roster.erl @@ -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', diff --git a/src/mod_roster_odbc.erl b/src/mod_roster_odbc.erl index 7ed173705..f23c04821 100644 --- a/src/mod_roster_odbc.erl +++ b/src/mod_roster_odbc.erl @@ -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', diff --git a/src/mod_shared_roster.erl b/src/mod_shared_roster.erl index 65c87711c..60e0e5234 100644 --- a/src/mod_shared_roster.erl +++ b/src/mod_shared_roster.erl @@ -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; diff --git a/src/mod_vcard.erl b/src/mod_vcard.erl index 23eaf66f7..156c88660 100644 --- a/src/mod_vcard.erl +++ b/src/mod_vcard.erl @@ -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">>), diff --git a/src/mod_vcard_ldap.erl b/src/mod_vcard_ldap.erl index 4ee43b84e..401ad0daf 100644 --- a/src/mod_vcard_ldap.erl +++ b/src/mod_vcard_ldap.erl @@ -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( diff --git a/src/mod_vcard_odbc.erl b/src/mod_vcard_odbc.erl index e92f164db..6f3cb96d7 100644 --- a/src/mod_vcard_odbc.erl +++ b/src/mod_vcard_odbc.erl @@ -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">>), diff --git a/src/web/ejabberd_web_admin.erl b/src/web/ejabberd_web_admin.erl index 0fda60468..21892def6 100644 --- a/src/web/ejabberd_web_admin.erl +++ b/src/web/ejabberd_web_admin.erl @@ -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) ->