Comparison

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
comparison
equal deleted inserted replaced
7780:dbd202e7c587 7786:b62353e6a8e5
107 local function make_authenticated(session, username) 107 local function make_authenticated(session, username)
108 username = nodeprep(username); 108 username = nodeprep(username);
109 if not username or #username == 0 then return nil, "Invalid username"; end 109 if not username or #username == 0 then return nil, "Invalid username"; end
110 session.username = username; 110 session.username = username;
111 if session.type == "c2s_unauthed" then 111 if session.type == "c2s_unauthed" then
112 session.type = "c2s"; 112 session.type = "c2s_unbound";
113 end 113 end
114 session.log("info", "Authenticated as %s@%s", username or "(unknown)", session.host or "(unknown)"); 114 session.log("info", "Authenticated as %s@%s", username or "(unknown)", session.host or "(unknown)");
115 return true; 115 return true;
116 end 116 end
117 117
175 175
176 session.resource = resource; 176 session.resource = resource;
177 session.full_jid = session.username .. '@' .. session.host .. '/' .. resource; 177 session.full_jid = session.username .. '@' .. session.host .. '/' .. resource;
178 hosts[session.host].sessions[session.username].sessions[resource] = session; 178 hosts[session.host].sessions[session.username].sessions[resource] = session;
179 full_sessions[session.full_jid] = session; 179 full_sessions[session.full_jid] = session;
180 if session.type == "c2s_unbound" then
181 session.type = "c2s";
182 end
180 183
181 local err; 184 local err;
182 session.roster, err = rm_load_roster(session.username, session.host); 185 session.roster, err = rm_load_roster(session.username, session.host);
183 if err then 186 if err then
184 full_sessions[session.full_jid] = nil; 187 full_sessions[session.full_jid] = nil;