diff options
author | Matthew Wild <mwild1@gmail.com> | 2008-10-24 07:34:13 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2008-10-24 07:34:13 +0100 |
commit | d49ea8a12e4440a0df267b575e4925231bda4803 (patch) | |
tree | 490259090b642a38634973be5ed4d8d42ec500d1 /core/sessionmanager.lua | |
parent | 1d1e9fba5745958c092d28563970f1acb4ee4604 (diff) | |
download | prosody-d49ea8a12e4440a0df267b575e4925231bda4803.tar.gz prosody-d49ea8a12e4440a0df267b575e4925231bda4803.zip |
Partial s2s commit
Diffstat (limited to 'core/sessionmanager.lua')
-rw-r--r-- | core/sessionmanager.lua | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/core/sessionmanager.lua b/core/sessionmanager.lua index d140ebe0..fd9b1272 100644 --- a/core/sessionmanager.lua +++ b/core/sessionmanager.lua @@ -35,14 +35,15 @@ end function destroy_session(session) session.log("info", "Destroying session"); - if session.username then + if session.host and 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; + if hosts[session.host] and hosts[session.host].sessions[session.username] then + 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; + end end end session.conn = nil; |