aboutsummaryrefslogtreecommitdiffstats
path: root/core/sessionmanager.lua
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2008-10-23 22:07:36 +0500
committerWaqas Hussain <waqas20@gmail.com>2008-10-23 22:07:36 +0500
commit0c483f2d09d84de33dbf7364a04986f7e64f9177 (patch)
tree9c8fc0905e981cf14634411d522255e53c943a27 /core/sessionmanager.lua
parent98a409f8b417a5b0600b7b60a5ed6598bfc0dd20 (diff)
parentdba8f998cf39a07fd93fb985a17b32a274fb23f3 (diff)
downloadprosody-0c483f2d09d84de33dbf7364a04986f7e64f9177.tar.gz
prosody-0c483f2d09d84de33dbf7364a04986f7e64f9177.zip
Merged from Matthew
Diffstat (limited to 'core/sessionmanager.lua')
-rw-r--r--core/sessionmanager.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/sessionmanager.lua b/core/sessionmanager.lua
index 19614311..d140ebe0 100644
--- a/core/sessionmanager.lua
+++ b/core/sessionmanager.lua
@@ -1,6 +1,6 @@
local tonumber, tostring = tonumber, tostring;
-local ipairs, pairs, print= ipairs, pairs, print;
+local ipairs, pairs, print, next= ipairs, pairs, print, next;
local collectgarbage = collectgarbage;
local m_random = import("math", "random");
local format = import("string", "format");
@@ -39,7 +39,9 @@ function destroy_session(session)
if session.resource then
hosts[session.host].sessions[session.username].sessions[session.resource] = nil;
end
- if not next(hosts[session.host].sessions[session.username], nil) 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