25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-10-11 15:08:56 +02:00

*** empty log message ***

SVN Revision: 22
This commit is contained in:
Alexey Shchepin 2002-12-25 19:41:25 +00:00
parent 6cf63ab17f
commit 8e2a94b71d
2 changed files with 14 additions and 3 deletions

View File

@ -181,10 +181,9 @@ session_established({xmlstreamelement, El}, StateData) ->
[FromJID, El, StateData]),
presence_update(FromJID, El, StateData);
_ ->
ejabberd_router:route({StateData#state.user,
Server, ""},
ToJID, El),
presence_track(FromJID, ToJID, El, StateData)
%ejabberd_router:route(FrJID, ToJID, El),
%NewSt
end;
_ ->
ejabberd_router:route(FromJID, ToJID, El),
@ -490,30 +489,38 @@ presence_track(From, To, Packet, StateData) ->
User = StateData#state.user,
case xml:get_attr_s("type", Attrs) of
"unavailable" ->
ejabberd_router:route(From, To, Packet),
I = remove_element(LTo, StateData#state.pres_i),
A = remove_element(LTo, StateData#state.pres_a),
StateData#state{pres_i = I,
pres_a = A};
"invisible" ->
ejabberd_router:route(From, To, Packet),
I = ?SETS:add_element(LTo, StateData#state.pres_i),
A = remove_element(LTo, StateData#state.pres_a),
StateData#state{pres_i = I,
pres_a = A};
"subscribe" ->
ejabberd_router:route(jlib:jid_remove_resource(From), To, Packet),
mod_roster:out_subscription(User, To, subscribe),
StateData;
"subscribed" ->
ejabberd_router:route(jlib:jid_remove_resource(From), To, Packet),
mod_roster:out_subscription(User, To, subscribed),
StateData;
"unsubscribe" ->
ejabberd_router:route(jlib:jid_remove_resource(From), To, Packet),
mod_roster:out_subscription(User, To, unsubscribe),
StateData;
"unsubscribed" ->
ejabberd_router:route(jlib:jid_remove_resource(From), To, Packet),
mod_roster:out_subscription(User, To, unsubscribed),
StateData;
"error" ->
ejabberd_router:route(From, To, Packet),
StateData;
_ ->
ejabberd_router:route(From, To, Packet),
I = remove_element(LTo, StateData#state.pres_i),
A = ?SETS:add_element(LTo, StateData#state.pres_a),
StateData#state{pres_i = I,

View File

@ -21,6 +21,7 @@
jid_to_string/1,
tolower/1,
jid_tolower/1,
jid_remove_resource/1,
get_iq_namespace/1,
iq_query_info/1,
is_iq_request_type/1,
@ -183,6 +184,9 @@ tolower(S) ->
jid_tolower({U, S, R}) ->
{tolower(U), tolower(S), R}.
jid_remove_resource({U, S, R}) ->
{U, S, ""}.
get_iq_namespace({xmlelement, Name, Attrs, Els}) when Name == "iq" ->
case xml:remove_cdata(Els) of
[{xmlelement, Name2, Attrs2, Els2}] ->