Changeset

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
parents 2590:2d7e2a28d1d5
children 2592:3af266f7037f
files core/sessionmanager.lua
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
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