mirror of
https://github.com/processone/ejabberd.git
synced 2025-01-03 18:02:28 +01:00
ejabberd_sm: Fix get_session_sid/3
Let get_session_sid/3 cope with multiple session table entries for a given resource.
This commit is contained in:
parent
08ce16f7ca
commit
63a60f1cd8
@ -314,8 +314,11 @@ get_session_sid(User, Server, Resource) ->
|
|||||||
LResource = jid:resourceprep(Resource),
|
LResource = jid:resourceprep(Resource),
|
||||||
Mod = get_sm_backend(LServer),
|
Mod = get_sm_backend(LServer),
|
||||||
case online(get_sessions(Mod, LUser, LServer, LResource)) of
|
case online(get_sessions(Mod, LUser, LServer, LResource)) of
|
||||||
[#session{sid = SID}] -> SID;
|
[] ->
|
||||||
_ -> none
|
none;
|
||||||
|
Ss ->
|
||||||
|
#session{sid = SID} = lists:max(Ss),
|
||||||
|
SID
|
||||||
end.
|
end.
|
||||||
|
|
||||||
-spec get_session_sids(binary(), binary()) -> [sid()].
|
-spec get_session_sids(binary(), binary()) -> [sid()].
|
||||||
|
Loading…
Reference in New Issue
Block a user