Software /
code /
prosody
Changeset
531:724fd647dc56
Quick fix for an issue that needs more looking into
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Wed, 03 Dec 2008 18:01:56 +0000 |
parents | 530:22ef9bab0834 |
children | 532:c24471cadc2c |
files | core/sessionmanager.lua |
diffstat | 1 files changed, 5 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/core/sessionmanager.lua Wed Dec 03 17:24:20 2008 +0000 +++ b/core/sessionmanager.lua Wed Dec 03 18:01:56 2008 +0000 @@ -70,10 +70,12 @@ -- Remove session/resource from user's session list if session.host and session.username then - if session.resource then - hosts[session.host].sessions[session.username].sessions[session.resource] = nil; - end + -- FIXME: How can the below ever be nil? (but they sometimes are...) if hosts[session.host] and hosts[session.host].sessions[session.username] then + if session.resource then + hosts[session.host].sessions[session.username].sessions[session.resource] = nil; + end + if not next(hosts[session.host].sessions[session.username].sessions) then log("debug", "All resources of %s are now offline", session.username); hosts[session.host].sessions[session.username] = nil;