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

Fix set_presence command (ejabberd-contrib#61)

This commit is contained in:
Badlop 2015-03-27 11:43:39 +01:00
parent 10dfd182f6
commit 8707c0b045
2 changed files with 5 additions and 2 deletions

View File

@ -1743,6 +1743,9 @@ handle_info(system_shutdown, StateName, StateData) ->
ok
end,
{stop, normal, StateData};
handle_info({route_xmlstreamelement, El}, StateName, StateData) ->
session_established({xmlstreamelement, El}, StateData),
fsm_next_state(StateName, StateData);
handle_info({force_update_presence, LUser}, StateName,
#state{user = LUser, server = LServer} = StateData) ->
NewStateData = case StateData#state.pres_last of

View File

@ -881,8 +881,8 @@ stringize(String) ->
set_presence(User, Host, Resource, Type, Show, Status, Priority) ->
Pid = ejabberd_sm:get_session_pid(User, Host, Resource),
USR = jlib:make_jid(User, Host, Resource),
US = jlib:make_jid(User, Host, <<>>),
USR = jlib:jid_to_string(jlib:make_jid(User, Host, Resource)),
US = jlib:jid_to_string(jlib:make_jid(User, Host, <<>>)),
Message = {route_xmlstreamelement,
{xmlel, <<"presence">>,
[{<<"from">>, USR}, {<<"to">>, US}, {<<"type">>, Type}],