Diff

core/sessionmanager.lua @ 7786:b62353e6a8e5

Merge 0.10->trunk
author Kim Alvefur <zash@zash.se>
date Wed, 14 Dec 2016 01:47:19 +0100
parent 7497:22942eda53f8
parent 7784:9f70d35a1602
child 7950:f91e7ec9654e
line wrap: on
line diff
--- a/core/sessionmanager.lua	Sat Dec 10 02:55:38 2016 +0100
+++ b/core/sessionmanager.lua	Wed Dec 14 01:47:19 2016 +0100
@@ -109,7 +109,7 @@
 	if not username or #username == 0 then return nil, "Invalid username"; end
 	session.username = username;
 	if session.type == "c2s_unauthed" then
-		session.type = "c2s";
+		session.type = "c2s_unbound";
 	end
 	session.log("info", "Authenticated as %s@%s", username or "(unknown)", session.host or "(unknown)");
 	return true;
@@ -177,6 +177,9 @@
 	session.full_jid = session.username .. '@' .. session.host .. '/' .. resource;
 	hosts[session.host].sessions[session.username].sessions[resource] = session;
 	full_sessions[session.full_jid] = session;
+	if session.type == "c2s_unbound" then
+		session.type = "c2s";
+	end
 
 	local err;
 	session.roster, err = rm_load_roster(session.username, session.host);