25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-26 17:38:45 +01:00

Mark out-of-reception sessions in #session.info

This commit is contained in:
Alexey Shchepin 2010-09-23 18:14:04 +03:00
parent 7127d067c8
commit a93991bef2

View File

@ -2245,8 +2245,15 @@ roster_change(IJID, ISubscription, StateData) ->
update_priority(Priority, Packet, StateData) -> update_priority(Priority, Packet, StateData) ->
Info = [{ip, StateData#state.ip}, {conn, StateData#state.conn}, Info1 = [{ip, StateData#state.ip}, {conn, StateData#state.conn},
{auth_module, StateData#state.auth_module}], {auth_module, StateData#state.auth_module}],
Info =
case StateData#state.reception of
false ->
[{oor, true} | Info1];
_ ->
Info1
end,
ejabberd_sm:set_presence(StateData#state.sid, ejabberd_sm:set_presence(StateData#state.sid,
StateData#state.user, StateData#state.user,
StateData#state.server, StateData#state.server,
@ -2502,7 +2509,7 @@ change_reception(#state{reception = true} = StateData, false) ->
[{xmlcdata, StateData#state.oor_show}]}, [{xmlcdata, StateData#state.oor_show}]},
{xmlelement, "status", [], {xmlelement, "status", [],
[{xmlcdata, StateData#state.oor_status}]}]}, [{xmlcdata, StateData#state.oor_status}]}]},
update_priority(0, Packet, StateData), update_priority(0, Packet, StateData#state{reception = false}),
presence_broadcast_to_trusted( presence_broadcast_to_trusted(
StateData, StateData,
StateData#state.jid, StateData#state.jid,
@ -2534,7 +2541,8 @@ change_reception(#state{reception = false} = StateData, true) ->
_ -> _ ->
Packet = StateData#state.pres_last, Packet = StateData#state.pres_last,
NewPriority = get_priority_from_presence(Packet), NewPriority = get_priority_from_presence(Packet),
update_priority(NewPriority, Packet, StateData), update_priority(NewPriority, Packet,
StateData#state{reception = true}),
presence_broadcast_to_trusted( presence_broadcast_to_trusted(
StateData, StateData,
StateData#state.jid, StateData#state.jid,