Diff

core/sessionmanager.lua @ 2591:d540a75a11db

sessionmanager: Fire resource-unbind event after removing session from sessions table
author Matthew Wild <mwild1@gmail.com>
date Thu, 11 Feb 2010 19:34:23 +0000
parent 2580:61f0acd9086f
child 2606:c3fe88d4b921
line wrap: on
line diff
--- a/core/sessionmanager.lua	Thu Feb 11 18:49:17 2010 +0000
+++ b/core/sessionmanager.lua	Thu Feb 11 19:34:23 2010 +0000
@@ -71,8 +71,6 @@
 	
 	-- Remove session/resource from user's session list
 	if session.full_jid then
-		hosts[session.host].events.fire_event("resource-unbind", {session=session, error=err});
-
 		hosts[session.host].sessions[session.username].sessions[session.resource] = nil;
 		full_sessions[session.full_jid] = nil;
 		
@@ -81,6 +79,8 @@
 			hosts[session.host].sessions[session.username] = nil;
 			bare_sessions[session.username..'@'..session.host] = nil;
 		end
+
+		hosts[session.host].events.fire_event("resource-unbind", {session=session, error=err});
 	end
 	
 	for k in pairs(session) do