25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +01:00

Fix (un)setting of priority

This commit is contained in:
Evgeny Khramtsov 2018-12-10 17:06:21 +03:00
parent e568dc3866
commit 8295bcebec

View File

@ -317,7 +317,7 @@ set_presence(SID, User, Server, Resource, Priority, Presence) ->
case get_sessions(Mod, LUser, LServer, LResource) of
[] -> {error, notfound};
Ss ->
case lists:keyfind(SID, 1, Ss) of
case lists:keyfind(SID, #session.sid, Ss) of
#session{info = Info} ->
set_session(SID, User, Server, Resource, Priority, Info),
ejabberd_hooks:run(set_presence_hook,
@ -339,7 +339,7 @@ unset_presence(SID, User, Server, Resource, Status) ->
case get_sessions(Mod, LUser, LServer, LResource) of
[] -> {error, notfound};
Ss ->
case lists:keyfind(SID, 1, Ss) of
case lists:keyfind(SID, #session.sid, Ss) of
#session{info = Info} ->
set_session(SID, User, Server, Resource, undefined, Info),
ejabberd_hooks:run(unset_presence_hook,