Software /
code /
prosody
Comparison
core/sessionmanager.lua @ 148:4c0dcd245d34 s2s
s2s works! \o/ \o/
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 24 Oct 2008 07:27:36 +0100 |
parent | 145:fbb3a4ff9cf1 |
child | 150:d09b8a1ab046 |
comparison
equal
deleted
inserted
replaced
147:ccebb2720741 | 148:4c0dcd245d34 |
---|---|
33 return session; | 33 return session; |
34 end | 34 end |
35 | 35 |
36 function destroy_session(session) | 36 function destroy_session(session) |
37 session.log("info", "Destroying session"); | 37 session.log("info", "Destroying session"); |
38 if session.username then | 38 if session.host and session.username then |
39 if session.resource then | 39 if session.resource then |
40 hosts[session.host].sessions[session.username].sessions[session.resource] = nil; | 40 hosts[session.host].sessions[session.username].sessions[session.resource] = nil; |
41 end | 41 end |
42 | 42 if hosts[session.host] and hosts[session.host].sessions[session.username] then |
43 if not next(hosts[session.host].sessions[session.username].sessions) then | 43 if not next(hosts[session.host].sessions[session.username].sessions) then |
44 log("debug", "All resources of %s are now offline", session.username); | 44 log("debug", "All resources of %s are now offline", session.username); |
45 hosts[session.host].sessions[session.username] = nil; | 45 hosts[session.host].sessions[session.username] = nil; |
46 end | |
46 end | 47 end |
47 end | 48 end |
48 session.conn = nil; | 49 session.conn = nil; |
49 session.disconnect = nil; | 50 session.disconnect = nil; |
50 for k in pairs(session) do | 51 for k in pairs(session) do |