Comparison

core/sessionmanager.lua @ 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 (2008-12-03)
parent 519:cccd610a0ef9
child 532:c24471cadc2c
comparison
equal deleted inserted replaced
530:22ef9bab0834 531:724fd647dc56
68 session.stanza_dispatch(pres); 68 session.stanza_dispatch(pres);
69 end 69 end
70 70
71 -- Remove session/resource from user's session list 71 -- Remove session/resource from user's session list
72 if session.host and session.username then 72 if session.host and session.username then
73 if session.resource then 73 -- FIXME: How can the below ever be nil? (but they sometimes are...)
74 hosts[session.host].sessions[session.username].sessions[session.resource] = nil;
75 end
76 if hosts[session.host] and hosts[session.host].sessions[session.username] then 74 if hosts[session.host] and hosts[session.host].sessions[session.username] then
75 if session.resource then
76 hosts[session.host].sessions[session.username].sessions[session.resource] = nil;
77 end
78
77 if not next(hosts[session.host].sessions[session.username].sessions) then 79 if not next(hosts[session.host].sessions[session.username].sessions) then
78 log("debug", "All resources of %s are now offline", session.username); 80 log("debug", "All resources of %s are now offline", session.username);
79 hosts[session.host].sessions[session.username] = nil; 81 hosts[session.host].sessions[session.username] = nil;
80 end 82 end
81 end 83 end