diff --git a/src/acl.erl b/src/acl.erl index 08061ab67..012918f14 100644 --- a/src/acl.erl +++ b/src/acl.erl @@ -231,7 +231,7 @@ match_acl(ACLName, JID, Host) -> all -> true; none -> false; _ -> - User = exmpp_jid:lnode_as_list(JID), + User = exmpp_jid:prep_node_as_list(JID), Server = exmpp_jid:prep_domain_as_list(JID), Resource = exmpp_jid:lresource_as_list(JID), lists:any(fun(#acl{aclspec = Spec}) -> diff --git a/src/ejabberd_s2s_in.erl b/src/ejabberd_s2s_in.erl index f1e3bff37..024708d9d 100644 --- a/src/ejabberd_s2s_in.erl +++ b/src/ejabberd_s2s_in.erl @@ -642,7 +642,7 @@ get_cert_domains(Cert) -> if D /= error -> JID = exmpp_jid:parse(D), - case {exmpp_jid:lnode_as_list(JID), + case {exmpp_jid:prep_node_as_list(JID), exmpp_jid:prep_domain_as_list(JID), exmpp_jid:lresource_as_list(JID)} of {undefined, LD, undefined} -> @@ -678,7 +678,7 @@ get_cert_domains(Cert) -> 'XmppAddr', XmppAddr) of {ok, D} when is_binary(D) -> JID2 = exmpp_jid:parse(binary_to_list(D)), - case {exmpp_jid:lnode_as_list(JID2), + case {exmpp_jid:prep_node_as_list(JID2), exmpp_jid:prep_domain_as_list(JID2), exmpp_jid:lresource_as_list(JID2)} of { undefined, LD, undefined} -> @@ -696,7 +696,7 @@ get_cert_domains(Cert) -> end; ({dNSName, D}) when is_list(D) -> JID3 = exmpp_jid:parse(D), - case {exmpp_jid:lnode_as_list(JID3), + case {exmpp_jid:prep_node_as_list(JID3), exmpp_jid:prep_domain_as_list(JID3), exmpp_jid:lresource_as_list(JID3)} of {undefined, LD, undefined} -> diff --git a/src/ejabberd_sm.erl b/src/ejabberd_sm.erl index 3ae27a1ca..941413cb3 100644 --- a/src/ejabberd_sm.erl +++ b/src/ejabberd_sm.erl @@ -575,7 +575,7 @@ route_message(From, To, Packet) -> 'headline' -> bounce_offline_message(From, To, Packet); _ -> - case ejabberd_auth:is_user_exists(exmpp_jid:lnode_as_list(To), + case ejabberd_auth:is_user_exists(exmpp_jid:prep_node_as_list(To), exmpp_jid:prep_domain_as_list(To)) of true -> ejabberd_hooks:run(offline_message_hook, diff --git a/src/mod_announce.erl b/src/mod_announce.erl index 1efd6d8cd..bf9699add 100644 --- a/src/mod_announce.erl +++ b/src/mod_announce.erl @@ -829,7 +829,7 @@ announce_motd_delete(LServer) -> send_motd(JID) -> LServer = exmpp_jid:prep_domain_as_list(JID), - LUser = exmpp_jid:lnode_as_list(JID), + LUser = exmpp_jid:prep_node_as_list(JID), case catch mnesia:dirty_read({motd, LServer}) of [#motd{packet = Packet}] -> US = {LUser, LServer}, diff --git a/src/mod_configure.erl b/src/mod_configure.erl index 2c701971d..4f16a2a46 100644 --- a/src/mod_configure.erl +++ b/src/mod_configure.erl @@ -1563,7 +1563,7 @@ set_form(From, Host, ?NS_ADMINL("add-user"), _Lang, XData) -> Password = get_value("password", XData), Password = get_value("password-verify", XData), AccountJID = exmpp_jid:parse(AccountString), - User = exmpp_jid:lnode_as_list(AccountJID), + User = exmpp_jid:prep_node_as_list(AccountJID), Server = exmpp_jid:prep_domain_as_list(AccountJID), true = lists:member(Server, ?MYHOSTS), true = (Server == Host) orelse (get_permission_level(From) == global), @@ -1576,7 +1576,7 @@ set_form(From, Host, ?NS_ADMINL("delete-user"), _Lang, XData) -> ASL2 = lists:map( fun(AccountString) -> JID = exmpp_jid:parse(AccountString), - User = [_|_] = exmpp_jid:lnode_as_list(JID), + User = [_|_] = exmpp_jid:prep_node_as_list(JID), Server = exmpp_jid:prep_domain_as_list(JID), true = (Server == Host) orelse (get_permission_level(From) == global), true = ejabberd_auth:is_user_exists(User, Server), @@ -1589,7 +1589,7 @@ set_form(From, Host, ?NS_ADMINL("delete-user"), _Lang, XData) -> set_form(From, Host, ?NS_ADMINL("end-user-session"), _Lang, XData) -> AccountString = get_value("accountjid", XData), JID = exmpp_jid:parse(AccountString), - LUser = [_|_] = exmpp_jid:lnode_as_list(JID), + LUser = [_|_] = exmpp_jid:prep_node_as_list(JID), LServer = exmpp_jid:prep_domain_as_list(JID), true = (LServer == Host) orelse (get_permission_level(From) == global), %% Code copied from ejabberd_sm.erl @@ -1608,7 +1608,7 @@ set_form(From, Host, ?NS_ADMINL("end-user-session"), _Lang, XData) -> set_form(From, Host, ?NS_ADMINL("get-user-password"), Lang, XData) -> AccountString = get_value("accountjid", XData), JID = exmpp_jid:parse(AccountString), - User = [_|_] = exmpp_jid:lnode_as_list(JID), + User = [_|_] = exmpp_jid:prep_node_as_list(JID), Server = exmpp_jid:prep_domain_as_list(JID), true = (Server == Host) orelse (get_permission_level(From) == global), Password = ejabberd_auth:get_password(User, Server), @@ -1623,7 +1623,7 @@ set_form(From, Host, ?NS_ADMINL("change-user-password"), _Lang, XData) -> AccountString = get_value("accountjid", XData), Password = get_value("password", XData), JID = exmpp_jid:parse(AccountString), - User = [_|_] = exmpp_jid:lnode_as_list(JID), + User = [_|_] = exmpp_jid:prep_node_as_list(JID), Server = exmpp_jid:prep_domain_as_list(JID), true = (Server == Host) orelse (get_permission_level(From) == global), true = ejabberd_auth:is_user_exists(User, Server), @@ -1633,7 +1633,7 @@ set_form(From, Host, ?NS_ADMINL("change-user-password"), _Lang, XData) -> set_form(From, Host, ?NS_ADMINL("get-user-lastlogin"), Lang, XData) -> AccountString = get_value("accountjid", XData), JID = exmpp_jid:parse(AccountString), - User = [_|_] = exmpp_jid:lnode_as_list(JID), + User = [_|_] = exmpp_jid:prep_node_as_list(JID), Server = exmpp_jid:prep_domain_as_list(JID), true = (Server == Host) orelse (get_permission_level(From) == global), @@ -1671,7 +1671,7 @@ set_form(From, Host, ?NS_ADMINL("get-user-lastlogin"), Lang, XData) -> set_form(From, Host, ?NS_ADMINL("user-stats"), Lang, XData) -> AccountString = get_value("accountjid", XData), JID = exmpp_jid:parse(AccountString), - User = [_|_] = exmpp_jid:lnode_as_list(JID), + User = [_|_] = exmpp_jid:prep_node_as_list(JID), Server = exmpp_jid:prep_domain_as_list(JID), true = (Server == Host) orelse (get_permission_level(From) == global), diff --git a/src/mod_disco.erl b/src/mod_disco.erl index 9b2357b64..f8dd45e71 100644 --- a/src/mod_disco.erl +++ b/src/mod_disco.erl @@ -289,9 +289,9 @@ process_sm_iq_items(From, To, #iq{type = get, payload = SubEl, exmpp_iq:error(IQ_Rec, Error) end; process_sm_iq_items(From, To, #iq{type = set, payload = SubEl} = IQ_Rec) -> - LTo = exmpp_jid:lnode_as_list(To), + LTo = exmpp_jid:prep_node_as_list(To), ToServer = exmpp_jid:prep_domain_as_list(To), - LFrom = exmpp_jid:lnode_as_list(From), + LFrom = exmpp_jid:prep_node_as_list(From), LServer = exmpp_jid:prep_domain_as_list(From), Self = (LTo == LFrom) andalso (ToServer == LServer), Node = exmpp_xml:get_attribute_as_list(SubEl, 'node', ""), @@ -314,9 +314,9 @@ get_sm_items({error, _Error} = Acc, _From, _To, _Node, _Lang) -> Acc; get_sm_items(Acc, From, To, <<>>, _Lang) -> - LFrom = exmpp_jid:lnode_as_list(From), + LFrom = exmpp_jid:prep_node_as_list(From), LSFrom = exmpp_jid:prep_domain_as_list(From), - LTo = exmpp_jid:lnode_as_list(To), + LTo = exmpp_jid:prep_node_as_list(To), LSTo = exmpp_jid:prep_domain_as_list(To), Items = case Acc of @@ -333,9 +333,9 @@ get_sm_items({result, _} = Acc, _From, _To, _Node, _Lang) -> Acc; get_sm_items(empty, From, To, _Node, _Lang) -> - LFrom = exmpp_jid:lnode_as_list(From), + LFrom = exmpp_jid:prep_node_as_list(From), LSFrom = exmpp_jid:prep_domain_as_list(From), - LTo = exmpp_jid:lnode_as_list(To), + LTo = exmpp_jid:prep_node_as_list(To), LSTo = exmpp_jid:prep_domain_as_list(To), case {LFrom, LSFrom} of {LTo, LSTo} -> @@ -375,9 +375,9 @@ get_sm_identity(Acc, _From, _To, _Node, _Lang) -> Acc. get_sm_features(empty, From, To, _Node, _Lang) -> - LFrom = exmpp_jid:lnode_as_list(From), + LFrom = exmpp_jid:prep_node_as_list(From), LSFrom = exmpp_jid:prep_domain_as_list(From), - LTo = exmpp_jid:lnode_as_list(To), + LTo = exmpp_jid:prep_node_as_list(To), LSTo = exmpp_jid:prep_domain_as_list(To), case {LFrom, LSFrom} of {LTo, LSTo} -> @@ -404,9 +404,9 @@ get_user_resources(JID) -> get_publish_items(empty, From, To, Node, _Lang) -> - LFrom = exmpp_jid:lnode_as_list(From), + LFrom = exmpp_jid:prep_node_as_list(From), LSFrom = exmpp_jid:prep_domain_as_list(From), - LTo = exmpp_jid:lnode_as_list(To), + LTo = exmpp_jid:prep_node_as_list(To), LSTo = exmpp_jid:prep_domain_as_list(To), if (LFrom == LTo) and (LSFrom == LSTo) -> diff --git a/src/mod_irc/mod_irc.erl b/src/mod_irc/mod_irc.erl index 31810489a..a12853d33 100644 --- a/src/mod_irc/mod_irc.erl +++ b/src/mod_irc/mod_irc.erl @@ -403,7 +403,7 @@ process_irc_register(Host, From, _To, _DefEnc, get_form(Host, From, [], Lang, DefEnc) -> User = exmpp_jid:node_as_list(From), Server = exmpp_jid:domain_as_list(From), - LUser = exmpp_jid:lnode_as_list(From), + LUser = exmpp_jid:prep_node_as_list(From), LServer = exmpp_jid:prep_domain_as_list(From), US = {LUser, LServer}, Customs = @@ -488,7 +488,7 @@ get_form(_Host, _, _, _Lang, _) -> set_form(Host, From, [], _Lang, XData) -> - LUser = exmpp_jid:lnode_as_list(From), + LUser = exmpp_jid:prep_node_as_list(From), LServer = exmpp_jid:prep_domain_as_list(From), US = {LUser, LServer}, case {lists:keysearch("username", 1, XData), @@ -534,7 +534,7 @@ set_form(_Host, _, _, _Lang, _XData) -> get_user_and_encoding(Host, From, IRCServer, DefEnc) -> User = exmpp_jid:node_as_list(From), - LUser = exmpp_jid:lnode_as_list(From), + LUser = exmpp_jid:prep_node_as_list(From), LServer = exmpp_jid:prep_domain_as_list(From), US = {LUser, LServer}, case catch mnesia:dirty_read({irc_custom, {US, Host}}) of diff --git a/src/mod_last_odbc.erl b/src/mod_last_odbc.erl index 738013b69..7bc552d8b 100644 --- a/src/mod_last_odbc.erl +++ b/src/mod_last_odbc.erl @@ -95,7 +95,7 @@ now_to_seconds({MegaSecs, Secs, _MicroSecs}) -> %%% Serve queries about user last online %%% process_sm_iq(From, To, #iq{type = get} = IQ_Rec) -> - User = exmpp_jid:lnode_as_list(To), + User = exmpp_jid:prep_node_as_list(To), Server = exmpp_jid:prep_domain_as_list(To), {Subscription, _Groups} = ejabberd_hooks:run_fold( diff --git a/src/mod_offline.erl b/src/mod_offline.erl index 7f59a5ea9..03217aede 100644 --- a/src/mod_offline.erl +++ b/src/mod_offline.erl @@ -161,7 +161,7 @@ store_packet(From, To, Packet) -> (Type /= <<"headline">>) -> case check_event(From, To, Packet) of true -> - LUser = exmpp_jid:lnode_as_list(To), + LUser = exmpp_jid:prep_node_as_list(To), LServer = exmpp_jid:prep_domain_as_list(To), TimeStamp = now(), Expire = find_x_expire(TimeStamp, Packet#xmlel.children), diff --git a/src/mod_offline_odbc.erl b/src/mod_offline_odbc.erl index 7e6fb3a29..d71b3d726 100644 --- a/src/mod_offline_odbc.erl +++ b/src/mod_offline_odbc.erl @@ -103,7 +103,7 @@ loop(Host, MaxOfflineMsgs) -> fun(M) -> Username = ejabberd_odbc:escape( - exmpp_jid:lnode_as_list(M#offline_msg.to)), + exmpp_jid:prep_node_as_list(M#offline_msg.to)), From = M#offline_msg.from, To = M#offline_msg.to, Packet0 = exmpp_stanza:set_jids( @@ -169,7 +169,7 @@ store_packet(From, To, Packet) -> (Type /= <<"headline">>) -> case check_event(From, To, Packet) of true -> - LUser = exmpp_jid:lnode_as_list(To), + LUser = exmpp_jid:prep_node_as_list(To), TimeStamp = now(), Expire = find_x_expire(TimeStamp, Packet#xmlel.children), gen_mod:get_module_proc(exmpp_jid:prep_domain_as_list(To), ?PROCNAME) ! diff --git a/src/mod_privacy.erl b/src/mod_privacy.erl index 2d8bb6d66..8ff718cfc 100644 --- a/src/mod_privacy.erl +++ b/src/mod_privacy.erl @@ -87,7 +87,7 @@ process_iq(_From, _To, IQ_Rec) -> process_iq_get(_, From, _To, #iq{payload = SubEl}, #userlist{name = Active}) -> - LUser = exmpp_jid:lnode_as_list(From), + LUser = exmpp_jid:prep_node_as_list(From), LServer = exmpp_jid:prep_domain_as_list(From), case exmpp_xml:get_child_elements(SubEl) of [] -> @@ -246,7 +246,7 @@ list_to_action(S) -> process_iq_set(_, From, _To, #iq{payload = SubEl}) -> - LUser = exmpp_jid:lnode_as_list(From), + LUser = exmpp_jid:prep_node_as_list(From), LServer = exmpp_jid:prep_domain_as_list(From), case exmpp_xml:get_child_elements(SubEl) of [#xmlel{name = Name} = Child] -> diff --git a/src/mod_privacy_odbc.erl b/src/mod_privacy_odbc.erl index 06b39111c..7d3b5316a 100644 --- a/src/mod_privacy_odbc.erl +++ b/src/mod_privacy_odbc.erl @@ -83,7 +83,7 @@ process_iq(_From, _To, IQ_Rec) -> process_iq_get(_, From, _To, #iq{payload = SubEl}, #userlist{name = Active}) -> - LUser = exmpp_jid:lnode_as_list(From), + LUser = exmpp_jid:prep_node_as_list(From), LServer = exmpp_jid:prep_domain_as_list(From), case exmpp_xml:get_child_elements(SubEl) of [] -> @@ -252,7 +252,7 @@ list_to_action(S) -> process_iq_set(_, From, _To, #iq{payload = SubEl}) -> - LUser = exmpp_jid:lnode_as_list(From), + LUser = exmpp_jid:prep_node_as_list(From), LServer = exmpp_jid:prep_domain_as_list(From), case exmpp_xml:get_child_elements(SubEl) of [#xmlel{name = Name} = Child] -> diff --git a/src/mod_private_odbc.erl b/src/mod_private_odbc.erl index 75bfc1841..3c16b5c79 100644 --- a/src/mod_private_odbc.erl +++ b/src/mod_private_odbc.erl @@ -67,7 +67,7 @@ process_sm_iq(From, To, #iq{type = Type} = IQ_Rec) -> end. process_iq_get(From, _To, #iq{payload = SubEl} = IQ_Rec) -> - LUser = exmpp_jid:lnode_as_list(From), + LUser = exmpp_jid:prep_node_as_list(From), LServer = exmpp_jid:prep_domain_as_list(From), case catch get_data(LUser, LServer, @@ -82,7 +82,7 @@ process_iq_get(From, _To, #iq{payload = SubEl} = IQ_Rec) -> process_iq_set(From, _To, #iq{payload = SubEl} = IQ_Rec) -> - LUser = exmpp_jid:lnode_as_list(From), + LUser = exmpp_jid:prep_node_as_list(From), LServer = exmpp_jid:prep_domain_as_list(From), F = fun() -> lists:foreach( diff --git a/src/mod_pubsub/nodetree_virtual.erl b/src/mod_pubsub/nodetree_virtual.erl index 00ea68cc4..bd9b74713 100644 --- a/src/mod_pubsub/nodetree_virtual.erl +++ b/src/mod_pubsub/nodetree_virtual.erl @@ -134,7 +134,7 @@ get_subnodes_tree(_Host, _Node) -> %% is considered as already created.

%%

default allowed nodes: /home/host/user/any/node/name

create_node(Host, Node, _Type, Owner, _Options) -> - UserName = exmpp_jid:lnode_as_list(Owner), + UserName = exmpp_jid:prep_node_as_list(Owner), UserHost = exmpp_jid:prep_domain_as_list(Owner), case Node of ["home", UserHost, UserName | _] -> {error, {virtual, {Host, Node}}}; diff --git a/src/mod_register.erl b/src/mod_register.erl index a84e8f184..f1dfa3bcf 100644 --- a/src/mod_register.erl +++ b/src/mod_register.erl @@ -87,7 +87,7 @@ unauthenticated_iq_register(Acc, _Server, _IQ, _IP) -> Acc. process_iq(From, To, IQ) -> - process_iq(From, To, IQ, {exmpp_jid:lnode_as_list(From), + process_iq(From, To, IQ, {exmpp_jid:prep_node_as_list(From), exmpp_jid:prep_domain_as_list(From), exmpp_jid:lresource_as_list(From)}). diff --git a/src/mod_shared_roster.erl b/src/mod_shared_roster.erl index aa132cba4..65c87711c 100644 --- a/src/mod_shared_roster.erl +++ b/src/mod_shared_roster.erl @@ -941,7 +941,7 @@ shared_roster_group_parse_query(Host, Group, Query) -> _ -> try JID = exmpp_jid:parse(SJID), - [{exmpp_jid:lnode_as_list(JID), exmpp_jid:prep_domain_as_list(JID)} | USs] + [{exmpp_jid:prep_node_as_list(JID), exmpp_jid:prep_domain_as_list(JID)} | USs] catch _ -> error diff --git a/src/mod_vcard.erl b/src/mod_vcard.erl index 820cee5f0..23eaf66f7 100644 --- a/src/mod_vcard.erl +++ b/src/mod_vcard.erl @@ -169,7 +169,7 @@ process_local_iq(_From, _To, #iq{type = set} = IQ_Rec) -> process_sm_iq(_From, To, #iq{type = get} = IQ_Rec) -> - LUser = exmpp_jid:lnode_as_list(To), + LUser = exmpp_jid:prep_node_as_list(To), LServer = exmpp_jid:prep_domain_as_list(To), US = {LUser, LServer}, F = fun() -> diff --git a/src/mod_vcard_ldap.erl b/src/mod_vcard_ldap.erl index ef746903b..4ee43b84e 100644 --- a/src/mod_vcard_ldap.erl +++ b/src/mod_vcard_ldap.erl @@ -254,7 +254,7 @@ process_vcard_ldap(To, IQ_Rec, Server) -> set -> exmpp_iq:error(IQ_Rec, 'not-allowed'); get -> - LUser = exmpp_jid:lnode_as_list(To), + LUser = exmpp_jid:prep_node_as_list(To), LServer = State#state.serverhost, case ejabberd_auth:is_user_exists(LUser, LServer) of true -> diff --git a/src/mod_vcard_odbc.erl b/src/mod_vcard_odbc.erl index f7ca4a9dd..e92f164db 100644 --- a/src/mod_vcard_odbc.erl +++ b/src/mod_vcard_odbc.erl @@ -131,7 +131,7 @@ process_local_iq(_From, _To, #iq{type = set} = IQ_Rec) -> process_sm_iq(_From, To, #iq{type = get} = IQ_Rec) -> - LUser = exmpp_jid:lnode_as_list(To), + LUser = exmpp_jid:prep_node_as_list(To), LServer = exmpp_jid:prep_domain_as_list(To), Username = ejabberd_odbc:escape(LUser), case catch odbc_queries:get_vcard(LServer, Username) of diff --git a/src/web/ejabberd_web_admin.erl b/src/web/ejabberd_web_admin.erl index ee5b1d5f1..0fda60468 100644 --- a/src/web/ejabberd_web_admin.erl +++ b/src/web/ejabberd_web_admin.erl @@ -1177,7 +1177,7 @@ string_to_spec("server_regexp", Val) -> {server_regexp, Val}; string_to_spec("node_regexp", Val) -> JID = exmpp_jid:parse(Val), - U = exmpp_jid:lnode_as_list(JID), + U = exmpp_jid:prep_node_as_list(JID), S = exmpp_jid:prep_domain_as_list(JID), undefined = exmpp_jid:resource(JID), {node_regexp, U, S}; @@ -1187,7 +1187,7 @@ string_to_spec("server_glob", Val) -> {server_glob, Val}; string_to_spec("node_glob", Val) -> JID = exmpp_jid:parse(Val), - U = exmpp_jid:lnode_as_list(JID), + U = exmpp_jid:prep_node_as_list(JID), S = exmpp_jid:prep_domain_as_list(JID), undefined = exmpp_jid:resource(JID), {node_glob, U, S}; @@ -1200,7 +1200,7 @@ string_to_spec("raw", Val) -> string_to_spec2(ACLName, Val) -> JID = exmpp_jid:parse(Val), - U = exmpp_jid:lnode_as_list(JID), + U = exmpp_jid:prep_node_as_list(JID), S = exmpp_jid:prep_domain_as_list(JID), undefined = exmpp_jid:resource(JID), case U of