25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-30 16:36:29 +01:00

API renaming : lresource -> prep_resource

SVN Revision: 2127
This commit is contained in:
Karim Gemayel 2009-06-01 16:42:07 +00:00
parent d51d9e9fff
commit 29c0e17ca2
11 changed files with 20 additions and 20 deletions

View File

@ -1920,7 +1920,7 @@ check_from(El, FromJID) ->
{value, SJID} ->
try
JIDEl = exmpp_jid:parse(SJID),
case exmpp_jid:lresource(JIDEl) of
case exmpp_jid:prep_resource(JIDEl) of
undefined ->
%% Matching JID: The stanza is ok
case exmpp_jid:compare_bare_jids(JIDEl, FromJID) of

View File

@ -304,7 +304,7 @@ do_route(From, To, Packet) ->
[From, To, Packet, 8]),
LNode = exmpp_jid:prep_node(To),
LResource = exmpp_jid:lresource(To),
LResource = exmpp_jid:prep_resource(To),
if
LNode /= undefined ->
ejabberd_sm:route(From, To, Packet);

View File

@ -161,7 +161,7 @@ get_user_resources(User, Server)
get_user_ip(JID) when ?IS_JID(JID) ->
USR = {exmpp_jid:prep_node(JID),
exmpp_jid:prep_domain(JID),
exmpp_jid:lresource(JID)},
exmpp_jid:prep_resource(JID)},
case mnesia:dirty_index_read(session, USR, #session.usr) of
[] ->
undefined;
@ -197,7 +197,7 @@ set_presence(SID, JID, Priority, Presence, Info) when ?IS_JID(JID) ->
exmpp_jid:prep_domain(JID),
[exmpp_jid:prep_node(JID),
exmpp_jid:prep_domain(JID),
exmpp_jid:lresource(JID),
exmpp_jid:prep_resource(JID),
Presence]).
unset_presence(SID, JID, Status, Info) when ?IS_JID(JID)->
@ -206,7 +206,7 @@ unset_presence(SID, JID, Status, Info) when ?IS_JID(JID)->
exmpp_jid:prep_domain(JID),
[exmpp_jid:prep_node(JID),
exmpp_jid:prep_domain(JID),
exmpp_jid:lresource(JID),
exmpp_jid:prep_resource(JID),
Status]).
close_session_unset_presence(SID, JID, Status) when ?IS_JID(JID) ->
@ -215,13 +215,13 @@ close_session_unset_presence(SID, JID, Status) when ?IS_JID(JID) ->
exmpp_jid:prep_domain(JID),
[exmpp_jid:prep_node(JID),
exmpp_jid:prep_domain(JID),
exmpp_jid:lresource(JID),
exmpp_jid:prep_resource(JID),
Status]).
get_session_pid(JID) when ?IS_JID(JID) ->
USR = {exmpp_jid:prep_node(JID),
exmpp_jid:prep_domain(JID),
exmpp_jid:lresource(JID)},
exmpp_jid:prep_resource(JID)},
case catch mnesia:dirty_index_read(session, USR, #session.usr) of
[#session{sid = {_, Pid}}] -> Pid;
_ -> none
@ -388,7 +388,7 @@ set_session(SID, JID, Priority, Info) ->
US = {exmpp_jid:prep_node(JID), exmpp_jid:prep_domain(JID)},
USR = {exmpp_jid:prep_node(JID),
exmpp_jid:prep_domain(JID),
exmpp_jid:lresource(JID)},
exmpp_jid:prep_resource(JID)},
F = fun() ->
mnesia:write(#session{sid = SID,
usr = USR,
@ -416,7 +416,7 @@ clean_table_from_bad_node(Node) ->
do_route(From, To, Packet) ->
?DEBUG("session manager~n\tfrom ~p~n\tto ~p~n\tpacket ~P~n",
[From, To, Packet, 8]),
case exmpp_jid:lresource(To) of
case exmpp_jid:prep_resource(To) of
undefined ->
case Packet of
_ when ?IS_PRESENCE(Packet) ->
@ -489,7 +489,7 @@ do_route(From, To, Packet) ->
_ ->
USR = {exmpp_jid:prep_node(To),
exmpp_jid:prep_domain(To),
exmpp_jid:lresource(To)},
exmpp_jid:prep_resource(To)},
case mnesia:dirty_index_read(session, USR, #session.usr) of
[] ->
case Packet of
@ -637,7 +637,7 @@ check_for_sessions_to_replace(JID) ->
check_existing_resources(JID) ->
USR = {exmpp_jid:prep_node(JID),
exmpp_jid:prep_domain(JID),
exmpp_jid:lresource(JID)},
exmpp_jid:prep_resource(JID)},
%% A connection exist with the same resource. We replace it:
SIDs = mnesia:dirty_select(
session,

View File

@ -60,7 +60,7 @@ end,
gen_server:start_link({local, ?MODULE}, ?MODULE, Opts, []).
process_command(From, To, Packet) ->
case {exmpp_jid:prep_node(To), exmpp_jid:lresource(To) } of
case {exmpp_jid:prep_node(To), exmpp_jid:prep_resource(To) } of
{undefined, <<"watchdog">>} ->
case Packet#xmlel.name of
'message' ->
@ -219,7 +219,7 @@ get_admin_jids() ->
JID = exmpp_jid:parse(S),
[{exmpp_jid:prep_node(JID),
exmpp_jid:prep_domain(JID),
exmpp_jid:lresource(JID)}]
exmpp_jid:prep_resource(JID)}]
catch
_ ->
[]

View File

@ -384,7 +384,7 @@ short_bare_jid(JID) ->
short_prepd_jid(JID) ->
{exmpp_jid:prep_node(JID),
exmpp_jid:prep_domain(JID),
exmpp_jid:lresource(JID)}.
exmpp_jid:prep_resource(JID)}.
short_prepd_bare_jid(JID) ->
short_prepd_jid(exmpp_jid:bare(JID)).

View File

@ -133,7 +133,7 @@ stop(Host) ->
%% Announcing via messages to a custom resource
announce(From, To, Packet) ->
case {exmpp_jid:prep_node(To), exmpp_jid:lresource(To)} of
case {exmpp_jid:prep_node(To), exmpp_jid:prep_resource(To)} of
{undefined, Res} ->
Name = Packet#xmlel.name,
Proc = gen_mod:get_module_proc(exmpp_jid:prep_domain_as_list(To), ?PROCNAME),

View File

@ -119,7 +119,7 @@ get_caps({U, S, R}, Retry) ->
%% clear_caps removes user caps from database
clear_caps(JID) ->
R = exmpp_jid:lresource(JID),
R = exmpp_jid:prep_resource(JID),
BJID = exmpp_jid:jid_to_binary(JID),
BUID = exmpp_jid:bare_jid_to_binary(JID),
catch mnesia:dirty_delete({user_caps, BJID}),

View File

@ -345,7 +345,7 @@ do_route1(Host, ServerHost, Access, HistorySize, RoomShaper,
From, To, Packet, DefRoomOpts) ->
{_AccessRoute, AccessCreate, AccessAdmin, _AccessPersistent} = Access,
Room = exmpp_jid:prep_node(To),
Nick = exmpp_jid:lresource(To),
Nick = exmpp_jid:prep_resource(To),
#xmlel{name = Name} = Packet,
case Room of
'undefined' ->

View File

@ -662,7 +662,7 @@ is_type_match(Type, Value, JID, Subscription, Groups) ->
{User, Server, Resource} = Value,
((User == undefined) orelse (User == []) orelse (User == exmpp_jid:prep_node(JID)))
andalso ((Server == undefined) orelse (Server == []) orelse (Server == exmpp_jid:prep_domain(JID)))
andalso ((Resource == undefined) orelse (Resource == []) orelse (Resource == exmpp_jid:lresource(JID)));
andalso ((Resource == undefined) orelse (Resource == []) orelse (Resource == exmpp_jid:prep_resource(JID)));
subscription ->
Value == Subscription;
group ->

View File

@ -661,7 +661,7 @@ is_type_match(Type, Value, JID, Subscription, Groups) ->
{User, Server, Resource} = Value,
((User == undefined) orelse (User == []) orelse (User == exmpp_jid:prep_node(JID)))
andalso ((Server == undefined) orelse (Server == []) orelse (Server == exmpp_jid:prep_domain(JID)))
andalso ((Resource == undefined) orelse (Resource == []) orelse (Resource == exmpp_jid:lresource(JID)));
andalso ((Resource == undefined) orelse (Resource == []) orelse (Resource == exmpp_jid:prep_resource(JID)));
subscription ->
Value == Subscription;
group ->

View File

@ -829,7 +829,7 @@ code_change(_OldVsn, State, _Extra) ->
do_route(ServerHost, Access, Plugins, Host, From, To, Packet) ->
#xmlel{name = Name} = Packet,
LNode = exmpp_jid:prep_node(To),
LRes = exmpp_jid:lresource(To),
LRes = exmpp_jid:prep_resource(To),
case {LNode, LRes} of
{undefined, undefined} ->
case Name of