get_priority_from_presence(OldPresence)
end,
NewPriority = get_priority_from_presence(Packet),
- update_priority(NewPriority, StateData),
+ update_priority(NewPriority, Packet, StateData),
FromUnavail = (StateData#state.pres_last == undefined) or
StateData#state.pres_invis,
?DEBUG("from unavail = ~p~n", [FromUnavail]),
end.
-update_priority(Pri, StateData) ->
+update_priority(Priority, Packet, StateData) ->
ejabberd_sm:set_presence(StateData#state.sid,
StateData#state.user,
StateData#state.server,
StateData#state.resource,
- Pri).
+ Priority,
+ Packet).
get_priority_from_presence(PresencePacket) ->
case xml:get_subtag(PresencePacket, "priority") of
bounce_offline_message/3,
disconnect_removed_user/2,
get_user_resources/2,
- set_presence/5,
+ set_presence/6,
unset_presence/5,
close_session_unset_presence/5,
dirty_get_sessions_list/0,
[element(3, S#session.usr) || S <- clean_session_list(Ss)]
end.
-set_presence(SID, User, Server, Resource, Priority) ->
+set_presence(SID, User, Server, Resource, Priority, Presence) ->
set_session(SID, User, Server, Resource, Priority),
ejabberd_hooks:run(set_presence_hook, jlib:nameprep(Server),
- [User, Server, Resource, Priority]).
+ [User, Server, Resource, Presence]).
unset_presence(SID, User, Server, Resource, Status) ->
set_session(SID, User, Server, Resource, undefined),