diff options
author | Matthew Wild <mwild1@gmail.com> | 2008-10-24 07:27:36 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2008-10-24 07:27:36 +0100 |
commit | 5c90ffdf7e7c7d784ed5f60eed3f8a2666c117f8 (patch) | |
tree | 00c7446dee596c9f5a2559a3e26109687e640669 /core/sessionmanager.lua | |
parent | 5031be1f8cb3a5a8785c07c5e4c5802913c209f6 (diff) | |
download | prosody-5c90ffdf7e7c7d784ed5f60eed3f8a2666c117f8.tar.gz prosody-5c90ffdf7e7c7d784ed5f60eed3f8a2666c117f8.zip |
s2s works! \o/ \o/
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 682f12df..2b7659d2 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; |