aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Khramtsov <ekhramtsov@process-one.net>2018-12-10 17:07:28 +0300
committerEvgeny Khramtsov <ekhramtsov@process-one.net>2018-12-10 17:07:28 +0300
commit33202d59c0cebdb09bbf81e98592a423f4caeef1 (patch)
tree0202f247ebc4f106b6bb8d8ef8d736cf6e66757b
parentMerge branch 'master' into mix (diff)
parentFix (un)setting of priority (diff)
Merge branch 'master' into mix
-rw-r--r--src/ejabberd_sm.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ejabberd_sm.erl b/src/ejabberd_sm.erl
index 4643f46b7..b8c85e9e8 100644
--- a/src/ejabberd_sm.erl
+++ b/src/ejabberd_sm.erl
@@ -326,7 +326,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,
@@ -348,7 +348,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,