Comparison

core/sessionmanager.lua @ 156:884c43c7028a

Fix for sessionmanager to not throw error when session doesn't have a private logger
author Matthew Wild <mwild1@gmail.com>
date Fri, 24 Oct 2008 14:47:23 +0100
parent 150:d09b8a1ab046
child 175:5f71d290bb44
comparison
equal deleted inserted replaced
155:8c9a9f6f6455 156:884c43c7028a
32 session.send = function (t) w(tostring(t)); end 32 session.send = function (t) w(tostring(t)); end
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 or log)("info", "Destroying session");
38 if session.host and 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 if hosts[session.host] and hosts[session.host].sessions[session.username] then 42 if hosts[session.host] and hosts[session.host].sessions[session.username] then