Diff

core/sessionmanager.lua @ 8184:dbcae15b4282

sessionmanager: Revert session.type if binding fails due to roster load error
author Matthew Wild <mwild1@gmail.com>
date Fri, 28 Jul 2017 23:45:05 +0100
parent 7949:8acc35b5355a
child 8185:e89320b8a789
child 9066:af97ecd00734
line wrap: on
line diff
--- a/core/sessionmanager.lua	Sun Jul 16 19:25:29 2017 +0100
+++ b/core/sessionmanager.lua	Fri Jul 28 23:45:05 2017 +0100
@@ -187,10 +187,14 @@
 	local err;
 	session.roster, err = rm_load_roster(session.username, session.host);
 	if err then
+		-- FIXME: Why is all this rollback down here, instead of just doing the roster test up above?
 		full_sessions[session.full_jid] = nil;
 		hosts[session.host].sessions[session.username].sessions[resource] = nil;
 		session.full_jid = nil;
 		session.resource = nil;
+		if session.type == "c2s" then
+			session.type = "c2s_unbound";
+		end
 		if next(bare_sessions[session.username..'@'..session.host].sessions) == nil then
 			bare_sessions[session.username..'@'..session.host] = nil;
 			hosts[session.host].sessions[session.username] = nil;