mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-26 17:38:45 +01:00
API renaming : make_jid -> make
SVN Revision: 2119
This commit is contained in:
parent
7c45f8f053
commit
447d3818f5
@ -241,7 +241,7 @@ wait_for_stream({xmlstreamstart, #xmlel{ns = NS} = Opening}, StateData) ->
|
|||||||
true ->
|
true ->
|
||||||
Lang = exmpp_stream:get_lang(Opening),
|
Lang = exmpp_stream:get_lang(Opening),
|
||||||
change_shaper(StateData,
|
change_shaper(StateData,
|
||||||
exmpp_jid:make_jid(ServerB)),
|
exmpp_jid:make(ServerB)),
|
||||||
case exmpp_stream:get_version(Opening) of
|
case exmpp_stream:get_version(Opening) of
|
||||||
{1, 0} ->
|
{1, 0} ->
|
||||||
send_element(StateData, Header),
|
send_element(StateData, Header),
|
||||||
@ -401,7 +401,7 @@ wait_for_auth({xmlstreamelement, El}, StateData) ->
|
|||||||
fsm_next_state(wait_for_auth, StateData);
|
fsm_next_state(wait_for_auth, StateData);
|
||||||
{auth, _ID, set, {U, P, D, R}} ->
|
{auth, _ID, set, {U, P, D, R}} ->
|
||||||
try
|
try
|
||||||
JID = exmpp_jid:make_jid(U, StateData#state.server, R),
|
JID = exmpp_jid:make(U, StateData#state.server, R),
|
||||||
UBinary = exmpp_jid:lnode(JID),
|
UBinary = exmpp_jid:lnode(JID),
|
||||||
case acl:match_rule(ServerString,
|
case acl:match_rule(ServerString,
|
||||||
StateData#state.access, JID) of
|
StateData#state.access, JID) of
|
||||||
@ -421,7 +421,7 @@ wait_for_auth({xmlstreamelement, El}, StateData) ->
|
|||||||
Info = [{ip, StateData#state.ip}, {conn, Conn},
|
Info = [{ip, StateData#state.ip}, {conn, Conn},
|
||||||
{auth_module, AuthModule}],
|
{auth_module, AuthModule}],
|
||||||
ejabberd_sm:open_session(
|
ejabberd_sm:open_session(
|
||||||
SID, exmpp_jid:make_jid(U, StateData#state.server, R), Info),
|
SID, exmpp_jid:make(U, StateData#state.server, R), Info),
|
||||||
Res = exmpp_server_legacy_auth:success(El),
|
Res = exmpp_server_legacy_auth:success(El),
|
||||||
send_element(StateData, Res),
|
send_element(StateData, Res),
|
||||||
change_shaper(StateData, JID),
|
change_shaper(StateData, JID),
|
||||||
@ -692,7 +692,7 @@ wait_for_bind({xmlstreamelement, El}, StateData) ->
|
|||||||
Resource ->
|
Resource ->
|
||||||
Resource
|
Resource
|
||||||
end,
|
end,
|
||||||
JID = exmpp_jid:make_jid(StateData#state.user, StateData#state.server, R),
|
JID = exmpp_jid:make(StateData#state.user, StateData#state.server, R),
|
||||||
Res = exmpp_server_binding:bind(El, JID),
|
Res = exmpp_server_binding:bind(El, JID),
|
||||||
send_element(StateData, Res),
|
send_element(StateData, Res),
|
||||||
fsm_next_state(wait_for_session,
|
fsm_next_state(wait_for_session,
|
||||||
@ -1107,7 +1107,7 @@ handle_info({route, From, To, Packet}, StateName, StateData) ->
|
|||||||
?DEBUG("broadcast~n~p~n", [Packet#xmlel.children]),
|
?DEBUG("broadcast~n~p~n", [Packet#xmlel.children]),
|
||||||
case Packet#xmlel.children of
|
case Packet#xmlel.children of
|
||||||
[{item, {U, S, R} = _IJIDShort, ISubscription}] ->
|
[{item, {U, S, R} = _IJIDShort, ISubscription}] ->
|
||||||
IJID = exmpp_jid:make_jid(U,
|
IJID = exmpp_jid:make(U,
|
||||||
S,
|
S,
|
||||||
R),
|
R),
|
||||||
{false, Attrs,
|
{false, Attrs,
|
||||||
@ -1586,7 +1586,7 @@ is_privacy_allow(From, To, Packet, PrivacyList) ->
|
|||||||
|
|
||||||
presence_broadcast(StateData, From, JIDSet, Packet) ->
|
presence_broadcast(StateData, From, JIDSet, Packet) ->
|
||||||
lists:foreach(fun({U, S, R}) ->
|
lists:foreach(fun({U, S, R}) ->
|
||||||
FJID = exmpp_jid:make_jid(U, S, R),
|
FJID = exmpp_jid:make(U, S, R),
|
||||||
case ejabberd_hooks:run_fold(
|
case ejabberd_hooks:run_fold(
|
||||||
privacy_check_packet, StateData#state.server,
|
privacy_check_packet, StateData#state.server,
|
||||||
allow,
|
allow,
|
||||||
@ -1607,7 +1607,7 @@ presence_broadcast_to_trusted(StateData, From, T, A, Packet) ->
|
|||||||
fun({U, S, R} = JID) ->
|
fun({U, S, R} = JID) ->
|
||||||
case ?SETS:is_element(JID, T) of
|
case ?SETS:is_element(JID, T) of
|
||||||
true ->
|
true ->
|
||||||
FJID = exmpp_jid:make_jid(U, S, R),
|
FJID = exmpp_jid:make(U, S, R),
|
||||||
case ejabberd_hooks:run_fold(
|
case ejabberd_hooks:run_fold(
|
||||||
privacy_check_packet, StateData#state.server,
|
privacy_check_packet, StateData#state.server,
|
||||||
allow,
|
allow,
|
||||||
@ -1630,7 +1630,7 @@ presence_broadcast_to_trusted(StateData, From, T, A, Packet) ->
|
|||||||
presence_broadcast_first(From, StateData, Packet) ->
|
presence_broadcast_first(From, StateData, Packet) ->
|
||||||
Probe = exmpp_presence:probe(),
|
Probe = exmpp_presence:probe(),
|
||||||
?SETS:fold(fun({U, S, R}, X) ->
|
?SETS:fold(fun({U, S, R}, X) ->
|
||||||
FJID = exmpp_jid:make_jid(U, S, R),
|
FJID = exmpp_jid:make(U, S, R),
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
From,
|
From,
|
||||||
FJID,
|
FJID,
|
||||||
@ -1645,7 +1645,7 @@ presence_broadcast_first(From, StateData, Packet) ->
|
|||||||
true ->
|
true ->
|
||||||
As = ?SETS:fold(
|
As = ?SETS:fold(
|
||||||
fun({U, S, R} = JID, A) ->
|
fun({U, S, R} = JID, A) ->
|
||||||
FJID = exmpp_jid:make_jid(U, S, R),
|
FJID = exmpp_jid:make(U, S, R),
|
||||||
case ejabberd_hooks:run_fold(
|
case ejabberd_hooks:run_fold(
|
||||||
privacy_check_packet, StateData#state.server,
|
privacy_check_packet, StateData#state.server,
|
||||||
allow,
|
allow,
|
||||||
@ -1869,7 +1869,7 @@ process_unauthenticated_stanza(StateData, El) when ?IS_IQ(El) ->
|
|||||||
ResIQ = exmpp_iq:error_without_original(El,
|
ResIQ = exmpp_iq:error_without_original(El,
|
||||||
'service-unavailable'),
|
'service-unavailable'),
|
||||||
Res1 = exmpp_stanza:set_sender(ResIQ,
|
Res1 = exmpp_stanza:set_sender(ResIQ,
|
||||||
exmpp_jid:make_jid(StateData#state.server)),
|
exmpp_jid:make(StateData#state.server)),
|
||||||
Res2 = exmpp_stanza:remove_recipient(Res1),
|
Res2 = exmpp_stanza:remove_recipient(Res1),
|
||||||
send_element(StateData, Res2);
|
send_element(StateData, Res2);
|
||||||
_ ->
|
_ ->
|
||||||
|
@ -408,14 +408,14 @@ new_connection(MyServer, Server, From, FromTo,
|
|||||||
|
|
||||||
max_s2s_connections_number({From, To}) ->
|
max_s2s_connections_number({From, To}) ->
|
||||||
case acl:match_rule(
|
case acl:match_rule(
|
||||||
From, max_s2s_connections, exmpp_jid:make_jid(To)) of
|
From, max_s2s_connections, exmpp_jid:make(To)) of
|
||||||
Max when is_integer(Max) -> Max;
|
Max when is_integer(Max) -> Max;
|
||||||
_ -> ?DEFAULT_MAX_S2S_CONNECTIONS_NUMBER
|
_ -> ?DEFAULT_MAX_S2S_CONNECTIONS_NUMBER
|
||||||
end.
|
end.
|
||||||
|
|
||||||
max_s2s_connections_number_per_node({From, To}) ->
|
max_s2s_connections_number_per_node({From, To}) ->
|
||||||
case acl:match_rule(
|
case acl:match_rule(
|
||||||
From, max_s2s_connections_per_node, exmpp_jid:make_jid(To)) of
|
From, max_s2s_connections_per_node, exmpp_jid:make(To)) of
|
||||||
Max when is_integer(Max) -> Max;
|
Max when is_integer(Max) -> Max;
|
||||||
_ -> ?DEFAULT_MAX_S2S_CONNECTIONS_NUMBER_PER_NODE
|
_ -> ?DEFAULT_MAX_S2S_CONNECTIONS_NUMBER_PER_NODE
|
||||||
end.
|
end.
|
||||||
|
@ -346,7 +346,7 @@ stream_established({xmlstreamelement, El}, StateData) ->
|
|||||||
Conns = ?DICT:store({LFrom, LTo}, wait_for_verification,
|
Conns = ?DICT:store({LFrom, LTo}, wait_for_verification,
|
||||||
StateData#state.connections),
|
StateData#state.connections),
|
||||||
change_shaper(StateData, LTo,
|
change_shaper(StateData, LTo,
|
||||||
exmpp_jid:make_jid(LFrom)),
|
exmpp_jid:make(LFrom)),
|
||||||
{next_state,
|
{next_state,
|
||||||
stream_established,
|
stream_established,
|
||||||
StateData#state{connections = Conns,
|
StateData#state{connections = Conns,
|
||||||
|
@ -142,8 +142,8 @@ bounce_offline_message(From, To, Packet) ->
|
|||||||
stop.
|
stop.
|
||||||
|
|
||||||
disconnect_removed_user(User, Server) ->
|
disconnect_removed_user(User, Server) ->
|
||||||
ejabberd_sm:route(exmpp_jid:make_jid(),
|
ejabberd_sm:route(exmpp_jid:make(),
|
||||||
exmpp_jid:make_jid(User,
|
exmpp_jid:make(User,
|
||||||
Server),
|
Server),
|
||||||
#xmlel{name = 'broadcast',
|
#xmlel{name = 'broadcast',
|
||||||
children = [{exit, "User removed"}]}).
|
children = [{exit, "User removed"}]}).
|
||||||
|
@ -190,7 +190,7 @@ process_large_heap(Pid, Info) ->
|
|||||||
"(~w) The process ~w is consuming too much memory:~n~p~n"
|
"(~w) The process ~w is consuming too much memory:~n~p~n"
|
||||||
"~s",
|
"~s",
|
||||||
[node(), Pid, Info, DetailedInfo]),
|
[node(), Pid, Info, DetailedInfo]),
|
||||||
From = exmpp_jid:make_jid(undefined, Host, <<"watchdog">>),
|
From = exmpp_jid:make(undefined, Host, <<"watchdog">>),
|
||||||
lists:foreach(
|
lists:foreach(
|
||||||
fun(S) ->
|
fun(S) ->
|
||||||
try
|
try
|
||||||
|
@ -115,7 +115,7 @@ process_xdb(_User, _Server, _El) ->
|
|||||||
xdb_data(_User, _Server, #xmlcdata{}) ->
|
xdb_data(_User, _Server, #xmlcdata{}) ->
|
||||||
ok;
|
ok;
|
||||||
xdb_data(User, Server, #xmlel{ns = NS} = El) ->
|
xdb_data(User, Server, #xmlel{ns = NS} = El) ->
|
||||||
From = exmpp_jid:make_jid(User, Server),
|
From = exmpp_jid:make(User, Server),
|
||||||
LServer = exmpp_stringprep:nameprep(Server),
|
LServer = exmpp_stringprep:nameprep(Server),
|
||||||
case NS of
|
case NS of
|
||||||
?NS_LEGACY_AUTH ->
|
?NS_LEGACY_AUTH ->
|
||||||
@ -156,12 +156,12 @@ xdb_data(User, Server, #xmlel{ns = NS} = El) ->
|
|||||||
true ->
|
true ->
|
||||||
catch mod_vcard_odbc:process_sm_iq(
|
catch mod_vcard_odbc:process_sm_iq(
|
||||||
From,
|
From,
|
||||||
exmpp_jid:make_jid(Server),
|
exmpp_jid:make(Server),
|
||||||
#iq{kind = request, type = set, ns = ?NS_VCARD, payload = El, iq_ns = ?NS_JABBER_CLIENT});
|
#iq{kind = request, type = set, ns = ?NS_VCARD, payload = El, iq_ns = ?NS_JABBER_CLIENT});
|
||||||
false ->
|
false ->
|
||||||
catch mod_vcard:process_sm_iq(
|
catch mod_vcard:process_sm_iq(
|
||||||
From,
|
From,
|
||||||
exmpp_jid:make_jid(Server),
|
exmpp_jid:make(Server),
|
||||||
#iq{kind = request, type = set, ns = ?NS_VCARD, payload = El, iq_ns = ?NS_JABBER_CLIENT})
|
#iq{kind = request, type = set, ns = ?NS_VCARD, payload = El, iq_ns = ?NS_JABBER_CLIENT})
|
||||||
end,
|
end,
|
||||||
ok;
|
ok;
|
||||||
@ -173,7 +173,7 @@ xdb_data(User, Server, #xmlel{ns = NS} = El) ->
|
|||||||
"1" ->
|
"1" ->
|
||||||
catch mod_private:process_sm_iq(
|
catch mod_private:process_sm_iq(
|
||||||
From,
|
From,
|
||||||
exmpp_jid:make_jid(Server),
|
exmpp_jid:make(Server),
|
||||||
#iq{kind = request, type = set, ns = ?NS_PRIVATE,
|
#iq{kind = request, type = set, ns = ?NS_PRIVATE,
|
||||||
iq_ns = ?NS_JABBER_CLIENT,
|
iq_ns = ?NS_JABBER_CLIENT,
|
||||||
payload = #xmlel{name = 'query', children =
|
payload = #xmlel{name = 'query', children =
|
||||||
@ -192,7 +192,7 @@ process_offline(Server, To, #xmlel{children = Els}) ->
|
|||||||
FromS = exmpp_stanza:get_sender(El),
|
FromS = exmpp_stanza:get_sender(El),
|
||||||
From = case FromS of
|
From = case FromS of
|
||||||
undefined ->
|
undefined ->
|
||||||
exmpp_jid:make_jid(Server);
|
exmpp_jid:make(Server);
|
||||||
_ ->
|
_ ->
|
||||||
try
|
try
|
||||||
exmpp_jid:parse_jid(FromS)
|
exmpp_jid:parse_jid(FromS)
|
||||||
|
@ -372,7 +372,7 @@ from_old_jid(JID) ->
|
|||||||
Node = exmpp_jid:node(JID),
|
Node = exmpp_jid:node(JID),
|
||||||
Resource = exmpp_jid:resource(JID),
|
Resource = exmpp_jid:resource(JID),
|
||||||
Domain = exmpp_jid:domain(JID),
|
Domain = exmpp_jid:domain(JID),
|
||||||
exmpp_jid:make_jid(Node,Domain,Resource).
|
exmpp_jid:make(Node,Domain,Resource).
|
||||||
|
|
||||||
|
|
||||||
short_jid(JID) ->
|
short_jid(JID) ->
|
||||||
|
@ -671,10 +671,10 @@ announce_all(From, To, Packet) ->
|
|||||||
Err = exmpp_stanza:reply_with_error(Packet, 'forbidden'),
|
Err = exmpp_stanza:reply_with_error(Packet, 'forbidden'),
|
||||||
ejabberd_router:route(To, From, Err);
|
ejabberd_router:route(To, From, Err);
|
||||||
allow ->
|
allow ->
|
||||||
Local = exmpp_jid:make_jid(exmpp_jid:domain(To)),
|
Local = exmpp_jid:make(exmpp_jid:domain(To)),
|
||||||
lists:foreach(
|
lists:foreach(
|
||||||
fun({User, Server}) ->
|
fun({User, Server}) ->
|
||||||
Dest = exmpp_jid:make_jid(User, Server),
|
Dest = exmpp_jid:make(User, Server),
|
||||||
ejabberd_router:route(Local, Dest, Packet)
|
ejabberd_router:route(Local, Dest, Packet)
|
||||||
end, ejabberd_auth:get_vh_registered_users(Host))
|
end, ejabberd_auth:get_vh_registered_users(Host))
|
||||||
end.
|
end.
|
||||||
@ -686,10 +686,10 @@ announce_all_hosts_all(From, To, Packet) ->
|
|||||||
Err = exmpp_stanza:reply_with_error(Packet, 'forbidden'),
|
Err = exmpp_stanza:reply_with_error(Packet, 'forbidden'),
|
||||||
ejabberd_router:route(To, From, Err);
|
ejabberd_router:route(To, From, Err);
|
||||||
allow ->
|
allow ->
|
||||||
Local = exmpp_jid:make_jid(exmpp_jid:domain(To)),
|
Local = exmpp_jid:make(exmpp_jid:domain(To)),
|
||||||
lists:foreach(
|
lists:foreach(
|
||||||
fun({User, Server}) ->
|
fun({User, Server}) ->
|
||||||
Dest = exmpp_jid:make_jid(User, Server),
|
Dest = exmpp_jid:make(User, Server),
|
||||||
ejabberd_router:route(Local, Dest, Packet)
|
ejabberd_router:route(Local, Dest, Packet)
|
||||||
end, ejabberd_auth:dirty_get_registered_users())
|
end, ejabberd_auth:dirty_get_registered_users())
|
||||||
end.
|
end.
|
||||||
@ -720,10 +720,10 @@ announce_all_hosts_online(From, To, Packet) ->
|
|||||||
end.
|
end.
|
||||||
|
|
||||||
announce_online1(Sessions, Server, Packet) ->
|
announce_online1(Sessions, Server, Packet) ->
|
||||||
Local = exmpp_jid:make_jid(Server),
|
Local = exmpp_jid:make(Server),
|
||||||
lists:foreach(
|
lists:foreach(
|
||||||
fun({U, S, R}) ->
|
fun({U, S, R}) ->
|
||||||
Dest = exmpp_jid:make_jid(U, S, R),
|
Dest = exmpp_jid:make(U, S, R),
|
||||||
ejabberd_router:route(Local, Dest, Packet)
|
ejabberd_router:route(Local, Dest, Packet)
|
||||||
end, Sessions).
|
end, Sessions).
|
||||||
|
|
||||||
@ -837,7 +837,7 @@ send_motd(JID) ->
|
|||||||
[#motd_users{}] ->
|
[#motd_users{}] ->
|
||||||
ok;
|
ok;
|
||||||
_ ->
|
_ ->
|
||||||
Local = exmpp_jid:make_jid(exmpp_jid:ldomain(JID)),
|
Local = exmpp_jid:make(exmpp_jid:ldomain(JID)),
|
||||||
ejabberd_router:route(Local, JID, Packet),
|
ejabberd_router:route(Local, JID, Packet),
|
||||||
F = fun() ->
|
F = fun() ->
|
||||||
mnesia:write(#motd_users{us = US})
|
mnesia:write(#motd_users{us = US})
|
||||||
|
@ -352,7 +352,7 @@ handle_cast({note_caps, From,
|
|||||||
Stanza = exmpp_iq:get(?NS_JABBER_CLIENT, Query, ID),
|
Stanza = exmpp_iq:get(?NS_JABBER_CLIENT, Query, ID),
|
||||||
ejabberd_local:register_iq_response_handler
|
ejabberd_local:register_iq_response_handler
|
||||||
(list_to_binary(Host), ID, ?MODULE, handle_disco_response),
|
(list_to_binary(Host), ID, ?MODULE, handle_disco_response),
|
||||||
ejabberd_router:route(exmpp_jid:make_jid(Host),
|
ejabberd_router:route(exmpp_jid:make(Host),
|
||||||
From, Stanza),
|
From, Stanza),
|
||||||
timer:send_after(?CAPS_QUERY_TIMEOUT, self(), {disco_timeout, ID}),
|
timer:send_after(?CAPS_QUERY_TIMEOUT, self(), {disco_timeout, ID}),
|
||||||
?DICT:store(ID, node_to_binary(Node, SubNode), Dict)
|
?DICT:store(ID, node_to_binary(Node, SubNode), Dict)
|
||||||
|
@ -1743,7 +1743,7 @@ stop_node(From, Host, ENode, Action, XData) ->
|
|||||||
[?XMLATTR('type', <<"submit">>)], children =
|
[?XMLATTR('type', <<"submit">>)], children =
|
||||||
SubEls}]
|
SubEls}]
|
||||||
},
|
},
|
||||||
To = exmpp_jid:make_jid(Host),
|
To = exmpp_jid:make(Host),
|
||||||
mod_announce:announce_commands(empty, From, To, Request)
|
mod_announce:announce_commands(empty, From, To, Request)
|
||||||
end,
|
end,
|
||||||
Time = timer:seconds(Delay),
|
Time = timer:seconds(Delay),
|
||||||
|
@ -252,7 +252,7 @@ handle_info({route_chan, Channel, Resource,
|
|||||||
case exmpp_message:get_subject(El) of
|
case exmpp_message:get_subject(El) of
|
||||||
undefined ->
|
undefined ->
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
exmpp_jid:make_jid(
|
exmpp_jid:make(
|
||||||
lists:concat(
|
lists:concat(
|
||||||
[Channel, "%", StateData#state.server]),
|
[Channel, "%", StateData#state.server]),
|
||||||
StateData#state.host, StateData#state.nick),
|
StateData#state.host, StateData#state.nick),
|
||||||
@ -369,7 +369,7 @@ handle_info({route_chan, Channel, Resource,
|
|||||||
El},
|
El},
|
||||||
StateName, StateData) when ?IS_IQ(El) ->
|
StateName, StateData) when ?IS_IQ(El) ->
|
||||||
From = StateData#state.user,
|
From = StateData#state.user,
|
||||||
To = exmpp_jid:make_jid(lists:concat([Channel, "%", StateData#state.server]),
|
To = exmpp_jid:make(lists:concat([Channel, "%", StateData#state.server]),
|
||||||
StateData#state.host, StateData#state.nick),
|
StateData#state.host, StateData#state.nick),
|
||||||
_ = case exmpp_iq:xmlel_to_iq(El) of
|
_ = case exmpp_iq:xmlel_to_iq(El) of
|
||||||
#iq{kind = request, ns = ?NS_MUC_ADMIN} = IQ_Rec ->
|
#iq{kind = request, ns = ?NS_MUC_ADMIN} = IQ_Rec ->
|
||||||
@ -586,7 +586,7 @@ terminate(_Reason, _StateName, StateData) ->
|
|||||||
lists:foreach(
|
lists:foreach(
|
||||||
fun(Chan) ->
|
fun(Chan) ->
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
exmpp_jid:make_jid(
|
exmpp_jid:make(
|
||||||
lists:concat([Chan, "%", StateData#state.server]),
|
lists:concat([Chan, "%", StateData#state.server]),
|
||||||
StateData#state.host, StateData#state.nick),
|
StateData#state.host, StateData#state.nick),
|
||||||
StateData#state.user,
|
StateData#state.user,
|
||||||
@ -686,7 +686,7 @@ process_channel_list_user(StateData, Chan, User) ->
|
|||||||
_ -> {User1, <<"member">>, <<"participant">>}
|
_ -> {User1, <<"member">>, <<"participant">>}
|
||||||
end,
|
end,
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
exmpp_jid:make_jid(lists:concat([Chan, "%", StateData#state.server]),
|
exmpp_jid:make(lists:concat([Chan, "%", StateData#state.server]),
|
||||||
StateData#state.host, User2),
|
StateData#state.host, User2),
|
||||||
StateData#state.user,
|
StateData#state.user,
|
||||||
#xmlel{ns = ?NS_JABBER_CLIENT, name = 'presence', children =
|
#xmlel{ns = ?NS_JABBER_CLIENT, name = 'presence', children =
|
||||||
@ -709,7 +709,7 @@ process_channel_topic(StateData, Chan, String) ->
|
|||||||
{ok, Msg, _} = regexp:sub(String, ".*332[^:]*:", ""),
|
{ok, Msg, _} = regexp:sub(String, ".*332[^:]*:", ""),
|
||||||
Msg1 = filter_message(Msg),
|
Msg1 = filter_message(Msg),
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
exmpp_jid:make_jid(
|
exmpp_jid:make(
|
||||||
lists:concat([Chan, "%", StateData#state.server]),
|
lists:concat([Chan, "%", StateData#state.server]),
|
||||||
StateData#state.host, ""),
|
StateData#state.host, ""),
|
||||||
StateData#state.user,
|
StateData#state.user,
|
||||||
@ -734,7 +734,7 @@ process_channel_topic_who(StateData, Chan, String) ->
|
|||||||
Msg2 = filter_message(Msg1),
|
Msg2 = filter_message(Msg1),
|
||||||
|
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
exmpp_jid:make_jid(lists:concat([Chan, "%", StateData#state.server]),
|
exmpp_jid:make(lists:concat([Chan, "%", StateData#state.server]),
|
||||||
StateData#state.host, ""),
|
StateData#state.host, ""),
|
||||||
StateData#state.user,
|
StateData#state.user,
|
||||||
exmpp_message:groupchat(Msg2)).
|
exmpp_message:groupchat(Msg2)).
|
||||||
@ -743,7 +743,7 @@ process_channel_topic_who(StateData, Chan, String) ->
|
|||||||
|
|
||||||
process_endofwhois(StateData, _String, Nick) ->
|
process_endofwhois(StateData, _String, Nick) ->
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
exmpp_jid:make_jid(lists:concat([Nick, "!", StateData#state.server]),
|
exmpp_jid:make(lists:concat([Nick, "!", StateData#state.server]),
|
||||||
StateData#state.host, ""),
|
StateData#state.host, ""),
|
||||||
StateData#state.user,
|
StateData#state.user,
|
||||||
exmpp_message:chat("End of WHOIS")).
|
exmpp_message:chat("End of WHOIS")).
|
||||||
@ -751,7 +751,7 @@ process_endofwhois(StateData, _String, Nick) ->
|
|||||||
process_whois311(StateData, String, Nick, Ident, Irchost) ->
|
process_whois311(StateData, String, Nick, Ident, Irchost) ->
|
||||||
{ok, Fullname, _} = regexp:sub(String, ".*311[^:]*:", ""),
|
{ok, Fullname, _} = regexp:sub(String, ".*311[^:]*:", ""),
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
exmpp_jid:make_jid(lists:concat([Nick, "!", StateData#state.server]),
|
exmpp_jid:make(lists:concat([Nick, "!", StateData#state.server]),
|
||||||
StateData#state.host, ""),
|
StateData#state.host, ""),
|
||||||
StateData#state.user,
|
StateData#state.user,
|
||||||
exmpp_message:chat(lists:concat(
|
exmpp_message:chat(lists:concat(
|
||||||
@ -761,7 +761,7 @@ process_whois311(StateData, String, Nick, Ident, Irchost) ->
|
|||||||
process_whois312(StateData, String, Nick, Ircserver) ->
|
process_whois312(StateData, String, Nick, Ircserver) ->
|
||||||
{ok, Ircserverdesc, _} = regexp:sub(String, ".*312[^:]*:", ""),
|
{ok, Ircserverdesc, _} = regexp:sub(String, ".*312[^:]*:", ""),
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
exmpp_jid:make_jid(lists:concat([Nick, "!", StateData#state.server]),
|
exmpp_jid:make(lists:concat([Nick, "!", StateData#state.server]),
|
||||||
StateData#state.host, ""),
|
StateData#state.host, ""),
|
||||||
StateData#state.user,
|
StateData#state.user,
|
||||||
exmpp_message:chat(lists:concat(["WHOIS: ", Nick, " use ",
|
exmpp_message:chat(lists:concat(["WHOIS: ", Nick, " use ",
|
||||||
@ -770,7 +770,7 @@ process_whois312(StateData, String, Nick, Ircserver) ->
|
|||||||
process_whois319(StateData, String, Nick) ->
|
process_whois319(StateData, String, Nick) ->
|
||||||
{ok, Chanlist, _} = regexp:sub(String, ".*319[^:]*:", ""),
|
{ok, Chanlist, _} = regexp:sub(String, ".*319[^:]*:", ""),
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
exmpp_jid:make_jid(lists:concat([Nick, "!", StateData#state.server]),
|
exmpp_jid:make(lists:concat([Nick, "!", StateData#state.server]),
|
||||||
StateData#state.host, ""),
|
StateData#state.host, ""),
|
||||||
StateData#state.user,
|
StateData#state.user,
|
||||||
exmpp_message:chat(lists:concat(["WHOIS: ", Nick, " is on ",
|
exmpp_message:chat(lists:concat(["WHOIS: ", Nick, " is on ",
|
||||||
@ -789,7 +789,7 @@ process_chanprivmsg(StateData, Chan, From, String) ->
|
|||||||
end,
|
end,
|
||||||
Msg2 = filter_message(Msg1),
|
Msg2 = filter_message(Msg1),
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
exmpp_jid:make_jid(lists:concat([Chan, "%", StateData#state.server]),
|
exmpp_jid:make(lists:concat([Chan, "%", StateData#state.server]),
|
||||||
StateData#state.host, FromUser),
|
StateData#state.host, FromUser),
|
||||||
StateData#state.user,
|
StateData#state.user,
|
||||||
exmpp_message:groupchat(Msg2)).
|
exmpp_message:groupchat(Msg2)).
|
||||||
@ -807,7 +807,7 @@ process_channotice(StateData, Chan, From, String) ->
|
|||||||
end,
|
end,
|
||||||
Msg2 = filter_message(Msg1),
|
Msg2 = filter_message(Msg1),
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
exmpp_jid:make_jid(lists:concat([Chan, "%", StateData#state.server]),
|
exmpp_jid:make(lists:concat([Chan, "%", StateData#state.server]),
|
||||||
StateData#state.host, FromUser),
|
StateData#state.host, FromUser),
|
||||||
StateData#state.user,
|
StateData#state.user,
|
||||||
exmpp_message:groupchat(Msg2)).
|
exmpp_message:groupchat(Msg2)).
|
||||||
@ -826,7 +826,7 @@ process_privmsg(StateData, _Nick, From, String) ->
|
|||||||
end,
|
end,
|
||||||
Msg2 = filter_message(Msg1),
|
Msg2 = filter_message(Msg1),
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
exmpp_jid:make_jid(lists:concat([FromUser, "!", StateData#state.server]),
|
exmpp_jid:make(lists:concat([FromUser, "!", StateData#state.server]),
|
||||||
StateData#state.host, undefined),
|
StateData#state.host, undefined),
|
||||||
StateData#state.user,
|
StateData#state.user,
|
||||||
exmpp_message:chat(Msg2)).
|
exmpp_message:chat(Msg2)).
|
||||||
@ -843,7 +843,7 @@ process_notice(StateData, _Nick, From, String) ->
|
|||||||
end,
|
end,
|
||||||
Msg2 = filter_message(Msg1),
|
Msg2 = filter_message(Msg1),
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
exmpp_jid:make_jid(lists:concat([FromUser, "!", StateData#state.server]),
|
exmpp_jid:make(lists:concat([FromUser, "!", StateData#state.server]),
|
||||||
StateData#state.host, undefined),
|
StateData#state.host, undefined),
|
||||||
StateData#state.user,
|
StateData#state.user,
|
||||||
exmpp_message:chat(Msg2)).
|
exmpp_message:chat(Msg2)).
|
||||||
@ -879,7 +879,7 @@ process_topic(StateData, Chan, From, String) ->
|
|||||||
{ok, Msg, _} = regexp:sub(String, ".*TOPIC[^:]*:", ""),
|
{ok, Msg, _} = regexp:sub(String, ".*TOPIC[^:]*:", ""),
|
||||||
Msg1 = filter_message(Msg),
|
Msg1 = filter_message(Msg),
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
exmpp_jid:make_jid(lists:concat([Chan, "%", StateData#state.server]),
|
exmpp_jid:make(lists:concat([Chan, "%", StateData#state.server]),
|
||||||
StateData#state.host, FromUser),
|
StateData#state.host, FromUser),
|
||||||
StateData#state.user,
|
StateData#state.user,
|
||||||
exmpp_message:groupchat(Msg1,
|
exmpp_message:groupchat(Msg1,
|
||||||
@ -890,7 +890,7 @@ process_part(StateData, Chan, From, String) ->
|
|||||||
{ok, Msg, _} = regexp:sub(String, ".*PART[^:]*:", ""),
|
{ok, Msg, _} = regexp:sub(String, ".*PART[^:]*:", ""),
|
||||||
Msg1 = filter_message(Msg),
|
Msg1 = filter_message(Msg),
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
exmpp_jid:make_jid(lists:concat([Chan, "%", StateData#state.server]),
|
exmpp_jid:make(lists:concat([Chan, "%", StateData#state.server]),
|
||||||
StateData#state.host, FromUser),
|
StateData#state.host, FromUser),
|
||||||
StateData#state.user,
|
StateData#state.user,
|
||||||
#xmlel{ns = ?NS_JABBER_CLIENT, name = 'presence', attrs = [?XMLATTR('type', <<"unavailable">>)], children =
|
#xmlel{ns = ?NS_JABBER_CLIENT, name = 'presence', attrs = [?XMLATTR('type', <<"unavailable">>)], children =
|
||||||
@ -923,7 +923,7 @@ process_quit(StateData, From, String) ->
|
|||||||
case ?SETS:is_member(FromUser, Ps) of
|
case ?SETS:is_member(FromUser, Ps) of
|
||||||
true ->
|
true ->
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
exmpp_jid:make_jid(
|
exmpp_jid:make(
|
||||||
lists:concat([Chan, "%", StateData#state.server]),
|
lists:concat([Chan, "%", StateData#state.server]),
|
||||||
StateData#state.host, FromUser),
|
StateData#state.host, FromUser),
|
||||||
StateData#state.user,
|
StateData#state.user,
|
||||||
@ -947,7 +947,7 @@ process_join(StateData, Channel, From, _String) ->
|
|||||||
[FromUser | FromIdent] = string:tokens(From, "!"),
|
[FromUser | FromIdent] = string:tokens(From, "!"),
|
||||||
Chan = lists:subtract(Channel, ":#"),
|
Chan = lists:subtract(Channel, ":#"),
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
exmpp_jid:make_jid(lists:concat([Chan, "%", StateData#state.server]),
|
exmpp_jid:make(lists:concat([Chan, "%", StateData#state.server]),
|
||||||
StateData#state.host, FromUser),
|
StateData#state.host, FromUser),
|
||||||
StateData#state.user,
|
StateData#state.user,
|
||||||
#xmlel{ns = ?NS_JABBER_CLIENT, name = 'presence', children =
|
#xmlel{ns = ?NS_JABBER_CLIENT, name = 'presence', children =
|
||||||
@ -973,7 +973,7 @@ process_join(StateData, Channel, From, _String) ->
|
|||||||
process_mode_o(StateData, Chan, _From, Nick, Affiliation, Role) ->
|
process_mode_o(StateData, Chan, _From, Nick, Affiliation, Role) ->
|
||||||
%Msg = lists:last(string:tokens(String, ":")),
|
%Msg = lists:last(string:tokens(String, ":")),
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
exmpp_jid:make_jid(lists:concat([Chan, "%", StateData#state.server]),
|
exmpp_jid:make(lists:concat([Chan, "%", StateData#state.server]),
|
||||||
StateData#state.host, Nick),
|
StateData#state.host, Nick),
|
||||||
StateData#state.user,
|
StateData#state.user,
|
||||||
#xmlel{ns = ?NS_JABBER_CLIENT, name = 'presence', children =
|
#xmlel{ns = ?NS_JABBER_CLIENT, name = 'presence', children =
|
||||||
@ -986,12 +986,12 @@ process_kick(StateData, Chan, From, Nick, String) ->
|
|||||||
Msg = lists:last(string:tokens(String, ":")),
|
Msg = lists:last(string:tokens(String, ":")),
|
||||||
Msg2 = Nick ++ " kicked by " ++ From ++ " (" ++ filter_message(Msg) ++ ")",
|
Msg2 = Nick ++ " kicked by " ++ From ++ " (" ++ filter_message(Msg) ++ ")",
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
exmpp_jid:make_jid(lists:concat([Chan, "%", StateData#state.server]),
|
exmpp_jid:make(lists:concat([Chan, "%", StateData#state.server]),
|
||||||
StateData#state.host, undefined),
|
StateData#state.host, undefined),
|
||||||
StateData#state.user,
|
StateData#state.user,
|
||||||
exmpp_message:groupchat(Msg2)),
|
exmpp_message:groupchat(Msg2)),
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
exmpp_jid:make_jid(lists:concat([Chan, "%", StateData#state.server]),
|
exmpp_jid:make(lists:concat([Chan, "%", StateData#state.server]),
|
||||||
StateData#state.host, Nick),
|
StateData#state.host, Nick),
|
||||||
StateData#state.user,
|
StateData#state.user,
|
||||||
#xmlel{ns = ?NS_JABBER_CLIENT, name = 'presence', attrs = [?XMLATTR('type', <<"unavailable">>)], children =
|
#xmlel{ns = ?NS_JABBER_CLIENT, name = 'presence', attrs = [?XMLATTR('type', <<"unavailable">>)], children =
|
||||||
@ -1011,7 +1011,7 @@ process_nick(StateData, From, NewNick) ->
|
|||||||
case ?SETS:is_member(FromUser, Ps) of
|
case ?SETS:is_member(FromUser, Ps) of
|
||||||
true ->
|
true ->
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
exmpp_jid:make_jid(
|
exmpp_jid:make(
|
||||||
lists:concat([Chan, "%", StateData#state.server]),
|
lists:concat([Chan, "%", StateData#state.server]),
|
||||||
StateData#state.host, FromUser),
|
StateData#state.host, FromUser),
|
||||||
StateData#state.user,
|
StateData#state.user,
|
||||||
@ -1024,7 +1024,7 @@ process_nick(StateData, From, NewNick) ->
|
|||||||
#xmlel{ns = ?NS_MUC_USER, name = 'status', attrs = [?XMLATTR('code', <<"303">>)]}
|
#xmlel{ns = ?NS_MUC_USER, name = 'status', attrs = [?XMLATTR('code', <<"303">>)]}
|
||||||
]}]}),
|
]}]}),
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
exmpp_jid:make_jid(
|
exmpp_jid:make(
|
||||||
lists:concat([Chan, "%", StateData#state.server]),
|
lists:concat([Chan, "%", StateData#state.server]),
|
||||||
StateData#state.host, Nick),
|
StateData#state.host, Nick),
|
||||||
StateData#state.user,
|
StateData#state.user,
|
||||||
@ -1047,7 +1047,7 @@ process_error(StateData, String) ->
|
|||||||
lists:foreach(
|
lists:foreach(
|
||||||
fun(Chan) ->
|
fun(Chan) ->
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
exmpp_jid:make_jid(
|
exmpp_jid:make(
|
||||||
lists:concat([Chan, "%", StateData#state.server]),
|
lists:concat([Chan, "%", StateData#state.server]),
|
||||||
StateData#state.host, StateData#state.nick),
|
StateData#state.host, StateData#state.nick),
|
||||||
StateData#state.user,
|
StateData#state.user,
|
||||||
|
@ -127,7 +127,7 @@ init([Host, ServerHost, Access, Room, HistorySize, RoomShaper, Creator, _Nick, D
|
|||||||
access = Access,
|
access = Access,
|
||||||
room = Room,
|
room = Room,
|
||||||
history = lqueue_new(HistorySize),
|
history = lqueue_new(HistorySize),
|
||||||
jid = exmpp_jid:make_jid(Room, Host),
|
jid = exmpp_jid:make(Room, Host),
|
||||||
just_created = true,
|
just_created = true,
|
||||||
room_shaper = Shaper}),
|
room_shaper = Shaper}),
|
||||||
State1 = set_opts(DefRoomOpts, State),
|
State1 = set_opts(DefRoomOpts, State),
|
||||||
@ -142,7 +142,7 @@ init([Host, ServerHost, Access, Room, HistorySize, RoomShaper, Opts]) ->
|
|||||||
access = Access,
|
access = Access,
|
||||||
room = Room,
|
room = Room,
|
||||||
history = lqueue_new(HistorySize),
|
history = lqueue_new(HistorySize),
|
||||||
jid = exmpp_jid:make_jid(Room, Host),
|
jid = exmpp_jid:make(Room, Host),
|
||||||
room_shaper = Shaper}),
|
room_shaper = Shaper}),
|
||||||
{ok, normal_state, State}.
|
{ok, normal_state, State}.
|
||||||
|
|
||||||
@ -1882,7 +1882,7 @@ send_existing_presences(ToJID, StateData) ->
|
|||||||
ok;
|
ok;
|
||||||
_ ->
|
_ ->
|
||||||
{N,D,R} = LJID,
|
{N,D,R} = LJID,
|
||||||
FromAffiliation = get_affiliation(exmpp_jid:make_jid(N,D,R),
|
FromAffiliation = get_affiliation(exmpp_jid:make(N,D,R),
|
||||||
StateData),
|
StateData),
|
||||||
ItemAttrs =
|
ItemAttrs =
|
||||||
case (Role == moderator) orelse
|
case (Role == moderator) orelse
|
||||||
@ -2632,7 +2632,7 @@ send_kickban_presence1(UJID, Reason, Code, StateData) ->
|
|||||||
{ok, #user{jid = _RealJID,
|
{ok, #user{jid = _RealJID,
|
||||||
nick = Nick}} = ?DICT:find(UJID, StateData#state.users),
|
nick = Nick}} = ?DICT:find(UJID, StateData#state.users),
|
||||||
{N,D,R} = UJID,
|
{N,D,R} = UJID,
|
||||||
Affiliation = get_affiliation(exmpp_jid:make_jid(N,D,R), StateData),
|
Affiliation = get_affiliation(exmpp_jid:make(N,D,R), StateData),
|
||||||
SAffiliation = affiliation_to_binary(Affiliation),
|
SAffiliation = affiliation_to_binary(Affiliation),
|
||||||
lists:foreach(
|
lists:foreach(
|
||||||
fun({_LJID, Info}) ->
|
fun({_LJID, Info}) ->
|
||||||
|
@ -363,8 +363,8 @@ process_list_set(LUser, LServer, Name, Els) ->
|
|||||||
Error;
|
Error;
|
||||||
{atomic, {result, _} = Res} ->
|
{atomic, {result, _} = Res} ->
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
exmpp_jid:make_jid(LUser, LServer),
|
exmpp_jid:make(LUser, LServer),
|
||||||
exmpp_jid:make_jid(LUser, LServer),
|
exmpp_jid:make(LUser, LServer),
|
||||||
#xmlel{name = 'broadcast',
|
#xmlel{name = 'broadcast',
|
||||||
children=[{privacy_list,
|
children=[{privacy_list,
|
||||||
#userlist{name = Name, list = []},
|
#userlist{name = Name, list = []},
|
||||||
@ -394,8 +394,8 @@ process_list_set(LUser, LServer, Name, Els) ->
|
|||||||
Error;
|
Error;
|
||||||
{atomic, {result, _} = Res} ->
|
{atomic, {result, _} = Res} ->
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
exmpp_jid:make_jid(LUser, LServer),
|
exmpp_jid:make(LUser, LServer),
|
||||||
exmpp_jid:make_jid(LUser, LServer),
|
exmpp_jid:make(LUser, LServer),
|
||||||
#xmlel{name = 'broadcast',
|
#xmlel{name = 'broadcast',
|
||||||
children=[{privacy_list,
|
children=[{privacy_list,
|
||||||
#userlist{name = Name, list = List},
|
#userlist{name = Name, list = List},
|
||||||
|
@ -363,8 +363,8 @@ process_list_set(LUser, LServer, Name, Els) ->
|
|||||||
Error;
|
Error;
|
||||||
{atomic, {result, _} = Res} ->
|
{atomic, {result, _} = Res} ->
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
exmpp_jid:make_jid(LUser, LServer),
|
exmpp_jid:make(LUser, LServer),
|
||||||
exmpp_jid:make_jid(LUser, LServer),
|
exmpp_jid:make(LUser, LServer),
|
||||||
#xmlel{name = 'broadcast',
|
#xmlel{name = 'broadcast',
|
||||||
children=[{privacy_list,
|
children=[{privacy_list,
|
||||||
#userlist{name = Name, list = []},
|
#userlist{name = Name, list = []},
|
||||||
@ -395,8 +395,8 @@ process_list_set(LUser, LServer, Name, Els) ->
|
|||||||
Error;
|
Error;
|
||||||
{atomic, {result, _} = Res} ->
|
{atomic, {result, _} = Res} ->
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
exmpp_jid:make_jid(LUser, LServer),
|
exmpp_jid:make(LUser, LServer),
|
||||||
exmpp_jid:make_jid(LUser, LServer),
|
exmpp_jid:make(LUser, LServer),
|
||||||
#xmlel{name = 'broadcast',
|
#xmlel{name = 'broadcast',
|
||||||
children=[{privacy_list,
|
children=[{privacy_list,
|
||||||
#userlist{name = Name, list = List},
|
#userlist{name = Name, list = List},
|
||||||
|
@ -640,7 +640,7 @@ presence_probe(Peer, JID, _Pid) ->
|
|||||||
%%
|
%%
|
||||||
|
|
||||||
out_subscription(User, Server, JID, subscribed) ->
|
out_subscription(User, Server, JID, subscribed) ->
|
||||||
Owner = exmpp_jid:make_jid(User, Server, ""),
|
Owner = exmpp_jid:make(User, Server, ""),
|
||||||
{U, S, R} = jlib:short_prepd_jid(JID),
|
{U, S, R} = jlib:short_prepd_jid(JID),
|
||||||
Rs = case R of
|
Rs = case R of
|
||||||
[] -> user_resources(U, S);
|
[] -> user_resources(U, S);
|
||||||
@ -651,7 +651,7 @@ out_subscription(User, Server, JID, subscribed) ->
|
|||||||
out_subscription(_, _, _, _) ->
|
out_subscription(_, _, _, _) ->
|
||||||
ok.
|
ok.
|
||||||
in_subscription(_, User, Server, Owner, unsubscribed, _) ->
|
in_subscription(_, User, Server, Owner, unsubscribed, _) ->
|
||||||
Subscriber = exmpp_jid:make_jid(User, Server, ""),
|
Subscriber = exmpp_jid:make(User, Server, ""),
|
||||||
Proc = gen_mod:get_module_proc(Server, ?PROCNAME),
|
Proc = gen_mod:get_module_proc(Server, ?PROCNAME),
|
||||||
gen_server:cast(Proc, {unsubscribe, Subscriber, Owner});
|
gen_server:cast(Proc, {unsubscribe, Subscriber, Owner});
|
||||||
in_subscription(_, _, _, _, _, _) ->
|
in_subscription(_, _, _, _, _, _) ->
|
||||||
@ -706,7 +706,7 @@ handle_cast({presence, User, Server, Resources, JID}, State) ->
|
|||||||
|
|
||||||
handle_cast({remove_user, LUser, LServer}, State) ->
|
handle_cast({remove_user, LUser, LServer}, State) ->
|
||||||
Host = State#state.host,
|
Host = State#state.host,
|
||||||
Owner = exmpp_jid:make_jid(LUser, LServer),
|
Owner = exmpp_jid:make(LUser, LServer),
|
||||||
%% remove user's subscriptions
|
%% remove user's subscriptions
|
||||||
lists:foreach(fun(PType) ->
|
lists:foreach(fun(PType) ->
|
||||||
{result, Subscriptions} = node_action(Host, PType, get_entity_subscriptions, [Host, Owner]),
|
{result, Subscriptions} = node_action(Host, PType, get_entity_subscriptions, [Host, Owner]),
|
||||||
@ -2042,7 +2042,7 @@ send_items(Host, Node, NodeId, Type, {LU, LS, LR} = LJID, Number) ->
|
|||||||
Stanza = event_stanza(
|
Stanza = event_stanza(
|
||||||
[#xmlel{ns = ?NS_PUBSUB_EVENT, name = 'items', attrs = nodeAttr(Node), children =
|
[#xmlel{ns = ?NS_PUBSUB_EVENT, name = 'items', attrs = nodeAttr(Node), children =
|
||||||
itemsEls(ToSend)}]),
|
itemsEls(ToSend)}]),
|
||||||
ejabberd_router ! {route, service_jid(Host), exmpp_jid:make_jid(LU, LS, LR), Stanza}.
|
ejabberd_router ! {route, service_jid(Host), exmpp_jid:make(LU, LS, LR), Stanza}.
|
||||||
|
|
||||||
%% @spec (Host, JID, Plugins) -> {error, Reason} | {result, Response}
|
%% @spec (Host, JID, Plugins) -> {error, Reason} | {result, Response}
|
||||||
%% Host = host()
|
%% Host = host()
|
||||||
@ -2411,8 +2411,8 @@ string_to_node(SNode) ->
|
|||||||
%% @doc <p>Generate pubsub service JID.</p>
|
%% @doc <p>Generate pubsub service JID.</p>
|
||||||
service_jid(Host) ->
|
service_jid(Host) ->
|
||||||
case Host of
|
case Host of
|
||||||
{U,S,_} -> exmpp_jid:make_jid(U, S);
|
{U,S,_} -> exmpp_jid:make(U, S);
|
||||||
_ -> exmpp_jid:make_jid(Host)
|
_ -> exmpp_jid:make(Host)
|
||||||
end.
|
end.
|
||||||
|
|
||||||
%% @spec (LJID, Subscription, PresenceDelivery) -> boolean()
|
%% @spec (LJID, Subscription, PresenceDelivery) -> boolean()
|
||||||
@ -2629,7 +2629,7 @@ broadcast_stanza(Host, Node, _NodeId, _Type, Options, Subscriptions, Stanza) ->
|
|||||||
%% set the from address on the notification to the bare JID of the account owner
|
%% set the from address on the notification to the bare JID of the account owner
|
||||||
%% Also, add "replyto" if entity has presence subscription to the account owner
|
%% Also, add "replyto" if entity has presence subscription to the account owner
|
||||||
%% See XEP-0163 1.1 section 4.3.1
|
%% See XEP-0163 1.1 section 4.3.1
|
||||||
Sender = exmpp_jid:make_jid(LUser, LServer),
|
Sender = exmpp_jid:make(LUser, LServer),
|
||||||
%%ReplyTo = jlib:make_jid(LUser, LServer, SenderResource), % This has to be used
|
%%ReplyTo = jlib:make_jid(LUser, LServer, SenderResource), % This has to be used
|
||||||
case catch ejabberd_c2s:get_subscribed(C2SPid) of
|
case catch ejabberd_c2s:get_subscribed(C2SPid) of
|
||||||
Contacts when is_list(Contacts) ->
|
Contacts when is_list(Contacts) ->
|
||||||
@ -2642,7 +2642,7 @@ broadcast_stanza(Host, Node, _NodeId, _Type, Options, Subscriptions, Stanza) ->
|
|||||||
end
|
end
|
||||||
end, [], user_resources(U, S)),
|
end, [], user_resources(U, S)),
|
||||||
lists:foreach(fun(R) ->
|
lists:foreach(fun(R) ->
|
||||||
ejabberd_router ! {route, Sender, exmpp_jid:make_jid(U, S, R), Stanza}
|
ejabberd_router ! {route, Sender, exmpp_jid:make(U, S, R), Stanza}
|
||||||
end, Rs)
|
end, Rs)
|
||||||
end)
|
end)
|
||||||
end, Contacts);
|
end, Contacts);
|
||||||
|
@ -99,7 +99,7 @@ create_node_permission(Host, ServerHost, _Node, _ParentNode, Owner, Access) ->
|
|||||||
true; % pubsub service always allowed
|
true; % pubsub service always allowed
|
||||||
_ ->
|
_ ->
|
||||||
{LU, LS, LR} = LOwner,
|
{LU, LS, LR} = LOwner,
|
||||||
acl:match_rule(ServerHost, Access, exmpp_jid:make_jid(LU, LS, LR)) =:= allow
|
acl:match_rule(ServerHost, Access, exmpp_jid:make(LU, LS, LR)) =:= allow
|
||||||
end,
|
end,
|
||||||
{result, Allowed}.
|
{result, Allowed}.
|
||||||
|
|
||||||
|
@ -203,7 +203,7 @@ create_node_permission(Host, ServerHost, Node, _ParentNode, Owner, Access) ->
|
|||||||
true; % pubsub service always allowed
|
true; % pubsub service always allowed
|
||||||
_ ->
|
_ ->
|
||||||
{LU, LS, LR} = LOwner,
|
{LU, LS, LR} = LOwner,
|
||||||
case acl:match_rule(ServerHost, Access, exmpp_jid:make_jid(LU, LS, LR)) of
|
case acl:match_rule(ServerHost, Access, exmpp_jid:make(LU, LS, LR)) of
|
||||||
allow ->
|
allow ->
|
||||||
case Node of
|
case Node of
|
||||||
["home", Server, User | _] -> true;
|
["home", Server, User | _] -> true;
|
||||||
|
@ -119,7 +119,7 @@ create_node_permission(Host, ServerHost, _Node, _ParentNode, Owner, Access) ->
|
|||||||
{undefined, Host, undefined} ->
|
{undefined, Host, undefined} ->
|
||||||
true; % pubsub service always allowed
|
true; % pubsub service always allowed
|
||||||
_ ->
|
_ ->
|
||||||
JID = exmpp_jid:make_jid(User, Server, Resource),
|
JID = exmpp_jid:make(User, Server, Resource),
|
||||||
case acl:match_rule(ServerHost, Access, JID) of
|
case acl:match_rule(ServerHost, Access, JID) of
|
||||||
allow ->
|
allow ->
|
||||||
case Host of
|
case Host of
|
||||||
|
@ -76,8 +76,8 @@ unauthenticated_iq_register(_Acc,
|
|||||||
{A, _Port} -> A;
|
{A, _Port} -> A;
|
||||||
_ -> undefined
|
_ -> undefined
|
||||||
end,
|
end,
|
||||||
BareJID = exmpp_jid:make_jid(Server),
|
BareJID = exmpp_jid:make(Server),
|
||||||
ResIQ = process_iq(exmpp_jid:make_jid(),
|
ResIQ = process_iq(exmpp_jid:make(),
|
||||||
BareJID,
|
BareJID,
|
||||||
IQ_Rec,
|
IQ_Rec,
|
||||||
Address),
|
Address),
|
||||||
@ -143,10 +143,10 @@ process_iq(From, To,
|
|||||||
{User, Server, Resource} ->
|
{User, Server, Resource} ->
|
||||||
ResIQ = exmpp_iq:result(IQ_Rec, SubEl),
|
ResIQ = exmpp_iq:result(IQ_Rec, SubEl),
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
exmpp_jid:make_jid(User,
|
exmpp_jid:make(User,
|
||||||
Server,
|
Server,
|
||||||
Resource),
|
Resource),
|
||||||
exmpp_jid:make_jid(User,
|
exmpp_jid:make(User,
|
||||||
Server,
|
Server,
|
||||||
Resource),
|
Resource),
|
||||||
exmpp_iq:iq_to_xmlel(ResIQ)),
|
exmpp_iq:iq_to_xmlel(ResIQ)),
|
||||||
@ -204,7 +204,7 @@ try_register(User, Server, Password, Source, Lang) ->
|
|||||||
false ->
|
false ->
|
||||||
{error, 'bad-request'};
|
{error, 'bad-request'};
|
||||||
_ ->
|
_ ->
|
||||||
JID = exmpp_jid:make_jid(User,
|
JID = exmpp_jid:make(User,
|
||||||
Server),
|
Server),
|
||||||
Access = gen_mod:get_module_opt(Server, ?MODULE, access, all),
|
Access = gen_mod:get_module_opt(Server, ?MODULE, access, all),
|
||||||
case acl:match_rule(Server, Access, JID) of
|
case acl:match_rule(Server, Access, JID) of
|
||||||
@ -247,7 +247,7 @@ send_welcome_message(JID) ->
|
|||||||
ok;
|
ok;
|
||||||
{Subj, Body} ->
|
{Subj, Body} ->
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
exmpp_jid:make_jid(Host),
|
exmpp_jid:make(Host),
|
||||||
JID,
|
JID,
|
||||||
exmpp_message:normal(Subj, Body));
|
exmpp_message:normal(Subj, Body));
|
||||||
_ ->
|
_ ->
|
||||||
@ -268,7 +268,7 @@ send_registration_notifications(UJID) ->
|
|||||||
try
|
try
|
||||||
JID = exmpp_jid:parse_jid(S),
|
JID = exmpp_jid:parse_jid(S),
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
exmpp_jid:make_jid(Host),
|
exmpp_jid:make(Host),
|
||||||
JID,
|
JID,
|
||||||
exmpp_message:chat(Body))
|
exmpp_message:chat(Body))
|
||||||
catch
|
catch
|
||||||
|
@ -301,14 +301,14 @@ process_item_set(From, To, #xmlel{} = El) ->
|
|||||||
if IsTo ->
|
if IsTo ->
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
exmpp_jid:jid_to_bare_jid(From),
|
exmpp_jid:jid_to_bare_jid(From),
|
||||||
exmpp_jid:make_jid(U, S, R),
|
exmpp_jid:make(U, S, R),
|
||||||
exmpp_presence:unsubscribe());
|
exmpp_presence:unsubscribe());
|
||||||
true -> ok
|
true -> ok
|
||||||
end,
|
end,
|
||||||
if IsFrom ->
|
if IsFrom ->
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
exmpp_jid:jid_to_bare_jid(From),
|
exmpp_jid:jid_to_bare_jid(From),
|
||||||
exmpp_jid:make_jid(U, S, R),
|
exmpp_jid:make(U, S, R),
|
||||||
exmpp_presence:unsubscribed());
|
exmpp_presence:unsubscribed());
|
||||||
true -> ok
|
true -> ok
|
||||||
end,
|
end,
|
||||||
@ -384,8 +384,8 @@ process_item_els(Item, []) ->
|
|||||||
|
|
||||||
push_item(User, Server, From, Item)
|
push_item(User, Server, From, Item)
|
||||||
when is_binary(User), is_binary(Server), ?IS_JID(From) ->
|
when is_binary(User), is_binary(Server), ?IS_JID(From) ->
|
||||||
ejabberd_sm:route(exmpp_jid:make_jid(),
|
ejabberd_sm:route(exmpp_jid:make(),
|
||||||
exmpp_jid:make_jid(User, Server),
|
exmpp_jid:make(User, Server),
|
||||||
#xmlel{name = 'broadcast', children =
|
#xmlel{name = 'broadcast', children =
|
||||||
[{item,
|
[{item,
|
||||||
Item#roster.jid,
|
Item#roster.jid,
|
||||||
@ -411,7 +411,7 @@ push_item(User, Server, Resource, From, Item)
|
|||||||
"push" ++ randoms:get_string()),
|
"push" ++ randoms:get_string()),
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
From,
|
From,
|
||||||
exmpp_jid:make_jid(User, Server, Resource),
|
exmpp_jid:make(User, Server, Resource),
|
||||||
ResIQ).
|
ResIQ).
|
||||||
|
|
||||||
%% @spec (Ignored, User, Server) -> Subscription_Lists
|
%% @spec (Ignored, User, Server) -> Subscription_Lists
|
||||||
@ -559,7 +559,7 @@ process_subscription(Direction, User, Server, JID1, Type, Reason)
|
|||||||
ok;
|
ok;
|
||||||
_ ->
|
_ ->
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
exmpp_jid:make_jid(User, Server), JID1,
|
exmpp_jid:make(User, Server), JID1,
|
||||||
exmpp_presence:AutoReply())
|
exmpp_presence:AutoReply())
|
||||||
end,
|
end,
|
||||||
case Push of
|
case Push of
|
||||||
@ -570,7 +570,7 @@ process_subscription(Direction, User, Server, JID1, Type, Reason)
|
|||||||
ok;
|
ok;
|
||||||
true ->
|
true ->
|
||||||
push_item(User, Server,
|
push_item(User, Server,
|
||||||
exmpp_jid:make_jid(User, Server), Item)
|
exmpp_jid:make(User, Server), Item)
|
||||||
end,
|
end,
|
||||||
true;
|
true;
|
||||||
none ->
|
none ->
|
||||||
@ -843,7 +843,7 @@ process_item_attrs_ws(Item, []) ->
|
|||||||
|
|
||||||
get_in_pending_subscriptions(Ls, User, Server)
|
get_in_pending_subscriptions(Ls, User, Server)
|
||||||
when is_binary(User), is_binary(Server) ->
|
when is_binary(User), is_binary(Server) ->
|
||||||
JID = exmpp_jid:make_jid(User, Server),
|
JID = exmpp_jid:make(User, Server),
|
||||||
US = {exmpp_jid:lnode(JID), exmpp_jid:ldomain(JID)},
|
US = {exmpp_jid:lnode(JID), exmpp_jid:ldomain(JID)},
|
||||||
case mnesia:dirty_index_read(roster, US, #roster.us) of
|
case mnesia:dirty_index_read(roster, US, #roster.us) of
|
||||||
Result when is_list(Result) ->
|
Result when is_list(Result) ->
|
||||||
@ -1184,7 +1184,7 @@ user_roster(User, Server, Query, Lang) ->
|
|||||||
|
|
||||||
build_contact_jid_td({U, S, R}) ->
|
build_contact_jid_td({U, S, R}) ->
|
||||||
%% Convert {U, S, R} into {jid, U, S, R, U, S, R}:
|
%% Convert {U, S, R} into {jid, U, S, R, U, S, R}:
|
||||||
ContactJID = exmpp_jid:make_jid(U, S, R),
|
ContactJID = exmpp_jid:make(U, S, R),
|
||||||
JIDURI = case {exmpp_jid:lnode(ContactJID), exmpp_jid:ldomain(ContactJID)} of
|
JIDURI = case {exmpp_jid:lnode(ContactJID), exmpp_jid:ldomain(ContactJID)} of
|
||||||
{undefined, _} -> "";
|
{undefined, _} -> "";
|
||||||
{CUser, CServer} ->
|
{CUser, CServer} ->
|
||||||
@ -1245,7 +1245,7 @@ user_roster_parse_query(User, Server, Items, Query) ->
|
|||||||
|
|
||||||
user_roster_subscribe_jid(User, Server, JID) ->
|
user_roster_subscribe_jid(User, Server, JID) ->
|
||||||
out_subscription(User, Server, JID, subscribe),
|
out_subscription(User, Server, JID, subscribe),
|
||||||
UJID = exmpp_jid:make_jid(User, Server),
|
UJID = exmpp_jid:make(User, Server),
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
UJID, JID, exmpp_presence:subscribe()).
|
UJID, JID, exmpp_presence:subscribe()).
|
||||||
|
|
||||||
@ -1263,10 +1263,10 @@ user_roster_item_parse_query(User, Server, Items, Query) ->
|
|||||||
"validate" ++ ejabberd_web_admin:term_to_id(JID), 1, Query) of
|
"validate" ++ ejabberd_web_admin:term_to_id(JID), 1, Query) of
|
||||||
{value, _} ->
|
{value, _} ->
|
||||||
{U, S, R} = JID,
|
{U, S, R} = JID,
|
||||||
JID1 = exmpp_jid:make_jid(U, S, R),
|
JID1 = exmpp_jid:make(U, S, R),
|
||||||
out_subscription(
|
out_subscription(
|
||||||
User, Server, JID1, subscribed),
|
User, Server, JID1, subscribed),
|
||||||
UJID = exmpp_jid:make_jid(User, Server),
|
UJID = exmpp_jid:make(User, Server),
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
UJID, JID1, exmpp_presence:subscribed()),
|
UJID, JID1, exmpp_presence:subscribed()),
|
||||||
throw(submitted);
|
throw(submitted);
|
||||||
@ -1275,7 +1275,7 @@ user_roster_item_parse_query(User, Server, Items, Query) ->
|
|||||||
"remove" ++ ejabberd_web_admin:term_to_id(JID), 1, Query) of
|
"remove" ++ ejabberd_web_admin:term_to_id(JID), 1, Query) of
|
||||||
{value, _} ->
|
{value, _} ->
|
||||||
{U, S, R} = JID,
|
{U, S, R} = JID,
|
||||||
UJID = exmpp_jid:make_jid(User, Server),
|
UJID = exmpp_jid:make(User, Server),
|
||||||
Attrs1 = exmpp_xml:set_attribute_in_list([],
|
Attrs1 = exmpp_xml:set_attribute_in_list([],
|
||||||
'jid', exmpp_jid:jid_to_list(U, S, R)),
|
'jid', exmpp_jid:jid_to_list(U, S, R)),
|
||||||
Attrs2 = exmpp_xml:set_attribute_in_list(Attrs1,
|
Attrs2 = exmpp_xml:set_attribute_in_list(Attrs1,
|
||||||
|
@ -285,14 +285,14 @@ process_item_set(From, To, #xmlel{} = El) ->
|
|||||||
if IsTo ->
|
if IsTo ->
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
exmpp_jid:jid_to_bare_jid(From),
|
exmpp_jid:jid_to_bare_jid(From),
|
||||||
exmpp_jid:make_jid(U, S, R),
|
exmpp_jid:make(U, S, R),
|
||||||
exmpp_presence:unsubscribe());
|
exmpp_presence:unsubscribe());
|
||||||
true -> ok
|
true -> ok
|
||||||
end,
|
end,
|
||||||
if IsFrom ->
|
if IsFrom ->
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
exmpp_jid:jid_to_bare_jid(From),
|
exmpp_jid:jid_to_bare_jid(From),
|
||||||
exmpp_jid:make_jid(U, S, R),
|
exmpp_jid:make(U, S, R),
|
||||||
exmpp_presence:unsubscribed());
|
exmpp_presence:unsubscribed());
|
||||||
true -> ok
|
true -> ok
|
||||||
end,
|
end,
|
||||||
@ -347,8 +347,8 @@ process_item_els(Item, []) ->
|
|||||||
|
|
||||||
|
|
||||||
push_item(User, Server, From, Item) when is_binary(User), is_binary(Server) ->
|
push_item(User, Server, From, Item) when is_binary(User), is_binary(Server) ->
|
||||||
ejabberd_sm:route(exmpp_jid:make_jid(),
|
ejabberd_sm:route(exmpp_jid:make(),
|
||||||
exmpp_jid:make_jid(User, Server),
|
exmpp_jid:make(User, Server),
|
||||||
#xmlel{name = 'broadcast', children =
|
#xmlel{name = 'broadcast', children =
|
||||||
[{item,
|
[{item,
|
||||||
Item#roster.jid,
|
Item#roster.jid,
|
||||||
@ -365,7 +365,7 @@ push_item(User, Server, Resource, From, Item) ->
|
|||||||
"push" ++ randoms:get_string()),
|
"push" ++ randoms:get_string()),
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
From,
|
From,
|
||||||
exmpp_jid:make_jid(User, Server, Resource),
|
exmpp_jid:make(User, Server, Resource),
|
||||||
ResIQ).
|
ResIQ).
|
||||||
|
|
||||||
get_subscription_lists(_, User, Server)
|
get_subscription_lists(_, User, Server)
|
||||||
@ -503,7 +503,7 @@ process_subscription(Direction, User, Server, JID1, Type, Reason)
|
|||||||
ok;
|
ok;
|
||||||
_ ->
|
_ ->
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
exmpp_jid:make_jid(User, Server), JID1,
|
exmpp_jid:make(User, Server), JID1,
|
||||||
exmpp_presence:AutoReply())
|
exmpp_presence:AutoReply())
|
||||||
end,
|
end,
|
||||||
case Push of
|
case Push of
|
||||||
@ -514,7 +514,7 @@ process_subscription(Direction, User, Server, JID1, Type, Reason)
|
|||||||
ok;
|
ok;
|
||||||
true ->
|
true ->
|
||||||
push_item(User, Server,
|
push_item(User, Server,
|
||||||
exmpp_jid:make_jid(User, Server), Item)
|
exmpp_jid:make(User, Server), Item)
|
||||||
end,
|
end,
|
||||||
true;
|
true;
|
||||||
none ->
|
none ->
|
||||||
@ -754,7 +754,7 @@ process_item_attrs_ws(Item, []) ->
|
|||||||
|
|
||||||
get_in_pending_subscriptions(Ls, User, Server)
|
get_in_pending_subscriptions(Ls, User, Server)
|
||||||
when is_binary(User), is_binary(Server) ->
|
when is_binary(User), is_binary(Server) ->
|
||||||
JID = exmpp_jid:make_jid(User, Server),
|
JID = exmpp_jid:make(User, Server),
|
||||||
LUser = exmpp_jid:lnode(JID),
|
LUser = exmpp_jid:lnode(JID),
|
||||||
LServer = exmpp_jid:ldomain_as_list(JID),
|
LServer = exmpp_jid:ldomain_as_list(JID),
|
||||||
Username = ejabberd_odbc:escape(LUser),
|
Username = ejabberd_odbc:escape(LUser),
|
||||||
@ -1019,7 +1019,7 @@ user_roster(User, Server, Query, Lang) ->
|
|||||||
|
|
||||||
build_contact_jid_td({U, S, R}) ->
|
build_contact_jid_td({U, S, R}) ->
|
||||||
%% Convert {U, S, R} into {jid, U, S, R, U, S, R}:
|
%% Convert {U, S, R} into {jid, U, S, R, U, S, R}:
|
||||||
ContactJID = exmpp_jid:make_jid(U, S, R),
|
ContactJID = exmpp_jid:make(U, S, R),
|
||||||
JIDURI = case {exmpp_jid:lnode(ContactJID), exmpp_jid:ldomain(ContactJID)} of
|
JIDURI = case {exmpp_jid:lnode(ContactJID), exmpp_jid:ldomain(ContactJID)} of
|
||||||
{undefined, _} -> "";
|
{undefined, _} -> "";
|
||||||
{CUser, CServer} ->
|
{CUser, CServer} ->
|
||||||
@ -1070,7 +1070,7 @@ user_roster_parse_query(User, Server, Items, Query) ->
|
|||||||
|
|
||||||
user_roster_subscribe_jid(User, Server, JID) ->
|
user_roster_subscribe_jid(User, Server, JID) ->
|
||||||
out_subscription(User, Server, JID, subscribe),
|
out_subscription(User, Server, JID, subscribe),
|
||||||
UJID = exmpp_jid:make_jid(User, Server),
|
UJID = exmpp_jid:make(User, Server),
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
UJID, JID, exmpp_presence:subscribe()).
|
UJID, JID, exmpp_presence:subscribe()).
|
||||||
|
|
||||||
@ -1082,10 +1082,10 @@ user_roster_item_parse_query(User, Server, Items, Query) ->
|
|||||||
"validate" ++ ejabberd_web_admin:term_to_id(JID), 1, Query) of
|
"validate" ++ ejabberd_web_admin:term_to_id(JID), 1, Query) of
|
||||||
{value, _} ->
|
{value, _} ->
|
||||||
{U, S, R} = JID,
|
{U, S, R} = JID,
|
||||||
JID1 = exmpp_jid:make_jid(U, S, R),
|
JID1 = exmpp_jid:make(U, S, R),
|
||||||
out_subscription(
|
out_subscription(
|
||||||
User, Server, JID1, subscribed),
|
User, Server, JID1, subscribed),
|
||||||
UJID = exmpp_jid:make_jid(User, Server),
|
UJID = exmpp_jid:make(User, Server),
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
UJID, JID1, exmpp_presence:subscribed()),
|
UJID, JID1, exmpp_presence:subscribed()),
|
||||||
throw(submitted);
|
throw(submitted);
|
||||||
@ -1093,7 +1093,7 @@ user_roster_item_parse_query(User, Server, Items, Query) ->
|
|||||||
case lists:keysearch(
|
case lists:keysearch(
|
||||||
"remove" ++ ejabberd_web_admin:term_to_id(JID), 1, Query) of
|
"remove" ++ ejabberd_web_admin:term_to_id(JID), 1, Query) of
|
||||||
{value, _} ->
|
{value, _} ->
|
||||||
UJID = exmpp_jid:make_jid(User, Server),
|
UJID = exmpp_jid:make(User, Server),
|
||||||
Attrs1 = exmpp_xml:set_attribute_in_list([],
|
Attrs1 = exmpp_xml:set_attribute_in_list([],
|
||||||
'jid', exmpp_jid:jid_to_list(JID)),
|
'jid', exmpp_jid:jid_to_list(JID)),
|
||||||
Attrs2 = exmpp_xml:set_attribute_in_list(Attrs1,
|
Attrs2 = exmpp_xml:set_attribute_in_list(Attrs1,
|
||||||
|
@ -63,13 +63,13 @@ log_user_receive(_JID, From, To, Packet) ->
|
|||||||
|
|
||||||
log_packet(From, To, Packet, Host) ->
|
log_packet(From, To, Packet, Host) ->
|
||||||
Loggers = gen_mod:get_module_opt(Host, ?MODULE, loggers, []),
|
Loggers = gen_mod:get_module_opt(Host, ?MODULE, loggers, []),
|
||||||
ServerJID = exmpp_jid:make_jid(Host),
|
ServerJID = exmpp_jid:make(Host),
|
||||||
FixedPacket = exmpp_stanza:set_jids(Packet, From, To),
|
FixedPacket = exmpp_stanza:set_jids(Packet, From, To),
|
||||||
lists:foreach(
|
lists:foreach(
|
||||||
fun(Logger) ->
|
fun(Logger) ->
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
ServerJID,
|
ServerJID,
|
||||||
exmpp_jid:make_jid(Logger),
|
exmpp_jid:make(Logger),
|
||||||
#xmlel{name = 'route', children = [FixedPacket]})
|
#xmlel{name = 'route', children = [FixedPacket]})
|
||||||
end, Loggers).
|
end, Loggers).
|
||||||
|
|
||||||
|
@ -199,12 +199,12 @@ process_item(RosterItem, Host) ->
|
|||||||
|
|
||||||
%% Remove pending out subscription
|
%% Remove pending out subscription
|
||||||
Mod:out_subscription(UserTo, ServerTo,
|
Mod:out_subscription(UserTo, ServerTo,
|
||||||
exmpp_jid:make_jid(UserFrom, ServerFrom),
|
exmpp_jid:make(UserFrom, ServerFrom),
|
||||||
unsubscribe),
|
unsubscribe),
|
||||||
|
|
||||||
%% Remove pending in subscription
|
%% Remove pending in subscription
|
||||||
Mod:in_subscription(aaaa, UserFrom, ServerFrom,
|
Mod:in_subscription(aaaa, UserFrom, ServerFrom,
|
||||||
exmpp_jid:make_jid(UserTo, ServerTo),
|
exmpp_jid:make(UserTo, ServerTo),
|
||||||
unsubscribe, ""),
|
unsubscribe, ""),
|
||||||
|
|
||||||
%% But we're still subscribed, so respond as such.
|
%% But we're still subscribed, so respond as such.
|
||||||
@ -237,9 +237,9 @@ set_new_rosteritems(UserFrom, ServerFrom,
|
|||||||
RIFrom = build_roster_record(UserFrom, ServerFrom,
|
RIFrom = build_roster_record(UserFrom, ServerFrom,
|
||||||
UserTo, ServerTo, NameTo, GroupsFrom),
|
UserTo, ServerTo, NameTo, GroupsFrom),
|
||||||
set_item(UserFrom, ServerFrom, ResourceTo, RIFrom),
|
set_item(UserFrom, ServerFrom, ResourceTo, RIFrom),
|
||||||
JIDTo = exmpp_jid:make_jid(UserTo, ServerTo),
|
JIDTo = exmpp_jid:make(UserTo, ServerTo),
|
||||||
|
|
||||||
JIDFrom = exmpp_jid:make_jid(UserFrom, ServerFrom),
|
JIDFrom = exmpp_jid:make(UserFrom, ServerFrom),
|
||||||
RITo = build_roster_record(UserTo, ServerTo,
|
RITo = build_roster_record(UserTo, ServerTo,
|
||||||
UserFrom, ServerFrom, UserFrom,[]),
|
UserFrom, ServerFrom, UserFrom,[]),
|
||||||
set_item(UserTo, ServerTo, undefined, RITo),
|
set_item(UserTo, ServerTo, undefined, RITo),
|
||||||
@ -268,8 +268,8 @@ set_item(User, Server, Resource, Item) ->
|
|||||||
ResIQ = exmpp_iq:set(?NS_JABBER_CLIENT, Request,
|
ResIQ = exmpp_iq:set(?NS_JABBER_CLIENT, Request,
|
||||||
"push" ++ randoms:get_string()),
|
"push" ++ randoms:get_string()),
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
exmpp_jid:make_jid(User, Server, Resource),
|
exmpp_jid:make(User, Server, Resource),
|
||||||
exmpp_jid:make_jid(Server),
|
exmpp_jid:make(Server),
|
||||||
ResIQ).
|
ResIQ).
|
||||||
|
|
||||||
|
|
||||||
@ -334,7 +334,7 @@ out_subscription(UserFrom, ServerFrom, JIDTo, unsubscribed) ->
|
|||||||
|
|
||||||
%% Remove pending out subscription
|
%% Remove pending out subscription
|
||||||
{UserTo, ServerTo, _} = jlib:short_prepd_bare_jid(JIDTo),
|
{UserTo, ServerTo, _} = jlib:short_prepd_bare_jid(JIDTo),
|
||||||
JIDFrom = exmpp_jid:make_jid(UserFrom, UserTo),
|
JIDFrom = exmpp_jid:make(UserFrom, UserTo),
|
||||||
Mod:out_subscription(UserTo, ServerTo, JIDFrom, unsubscribe),
|
Mod:out_subscription(UserTo, ServerTo, JIDFrom, unsubscribe),
|
||||||
|
|
||||||
%% Remove pending in subscription
|
%% Remove pending in subscription
|
||||||
@ -684,7 +684,7 @@ push_item(User, Server, From, Item) ->
|
|||||||
%% ejabberd_sm:route(jlib:make_jid("", "", ""),
|
%% ejabberd_sm:route(jlib:make_jid("", "", ""),
|
||||||
%% jlib:make_jid(User, Server, "")
|
%% jlib:make_jid(User, Server, "")
|
||||||
%% why?
|
%% why?
|
||||||
ejabberd_sm:route(From, exmpp_jid:make_jid(User, Server),
|
ejabberd_sm:route(From, exmpp_jid:make(User, Server),
|
||||||
#xmlel{name = 'broadcast', children =
|
#xmlel{name = 'broadcast', children =
|
||||||
[{item,
|
[{item,
|
||||||
Item#roster.jid,
|
Item#roster.jid,
|
||||||
@ -695,7 +695,7 @@ push_item(User, Server, From, Item) ->
|
|||||||
"push" ++ randoms:get_string()),
|
"push" ++ randoms:get_string()),
|
||||||
lists:foreach(
|
lists:foreach(
|
||||||
fun(Resource) ->
|
fun(Resource) ->
|
||||||
JID = exmpp_jid:make_jid(User, Server, Resource),
|
JID = exmpp_jid:make(User, Server, Resource),
|
||||||
ejabberd_router:route(JID, JID, Stanza)
|
ejabberd_router:route(JID, JID, Stanza)
|
||||||
end, ejabberd_sm:get_user_resources(list_to_binary(User), list_to_binary(Server))).
|
end, ejabberd_sm:get_user_resources(list_to_binary(User), list_to_binary(Server))).
|
||||||
|
|
||||||
@ -707,7 +707,7 @@ push_roster_item(User, Server, ContactU, ContactS, GroupName, Subscription) ->
|
|||||||
subscription = Subscription,
|
subscription = Subscription,
|
||||||
ask = none,
|
ask = none,
|
||||||
groups = [GroupName]},
|
groups = [GroupName]},
|
||||||
push_item(User, Server, exmpp_jid:make_jid(Server), Item).
|
push_item(User, Server, exmpp_jid:make(Server), Item).
|
||||||
|
|
||||||
item_to_xml(Item) ->
|
item_to_xml(Item) ->
|
||||||
{U, S, R} = Item#roster.jid,
|
{U, S, R} = Item#roster.jid,
|
||||||
|
@ -423,14 +423,14 @@ resend_message(Packet) ->
|
|||||||
get_jid("from", ParsedPacket) ->
|
get_jid("from", ParsedPacket) ->
|
||||||
case exmpp_stanza:get_sender(ParsedPacket) of
|
case exmpp_stanza:get_sender(ParsedPacket) of
|
||||||
undefined ->
|
undefined ->
|
||||||
exmpp_jid:make_jid();
|
exmpp_jid:make();
|
||||||
From ->
|
From ->
|
||||||
exmpp_jid:parse_jid(From)
|
exmpp_jid:parse_jid(From)
|
||||||
end;
|
end;
|
||||||
get_jid("to", ParsedPacket) ->
|
get_jid("to", ParsedPacket) ->
|
||||||
case exmpp_stanza:get_recipient(ParsedPacket) of
|
case exmpp_stanza:get_recipient(ParsedPacket) of
|
||||||
undefined ->
|
undefined ->
|
||||||
exmpp_jid:make_jid();
|
exmpp_jid:make();
|
||||||
From ->
|
From ->
|
||||||
exmpp_jid:parse_jid(From)
|
exmpp_jid:parse_jid(From)
|
||||||
end.
|
end.
|
||||||
|
@ -77,7 +77,7 @@ process(["server", SHost | RPath], #request{auth = Auth} = Request) ->
|
|||||||
case get_auth(Auth) of
|
case get_auth(Auth) of
|
||||||
{User, Server} ->
|
{User, Server} ->
|
||||||
case acl:match_rule(
|
case acl:match_rule(
|
||||||
Host, configure, exmpp_jid:make_jid(User, Server)) of
|
Host, configure, exmpp_jid:make(User, Server)) of
|
||||||
deny ->
|
deny ->
|
||||||
ejabberd_web:error(not_allowed);
|
ejabberd_web:error(not_allowed);
|
||||||
allow ->
|
allow ->
|
||||||
@ -99,7 +99,7 @@ process(RPath, #request{auth = Auth} = Request) ->
|
|||||||
case get_auth(Auth) of
|
case get_auth(Auth) of
|
||||||
{User, Server} ->
|
{User, Server} ->
|
||||||
case acl:match_rule(
|
case acl:match_rule(
|
||||||
global, configure, exmpp_jid:make_jid(User, Server)) of
|
global, configure, exmpp_jid:make(User, Server)) of
|
||||||
deny ->
|
deny ->
|
||||||
ejabberd_web:error(not_allowed);
|
ejabberd_web:error(not_allowed);
|
||||||
allow ->
|
allow ->
|
||||||
|
Loading…
Reference in New Issue
Block a user