diff options
-rw-r--r-- | src/ejabberd_sm.erl | 4 |
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, |