Software /
code /
prosody
Changeset
7784:9f70d35a1602
core.sessionmanager, mod_saslauth: Introduce intermediate session type for authenticated but unbound sessions so that resource binding is not treated as a normal stanza
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Tue, 13 Dec 2016 18:15:17 +0100 |
parents | 7783:f54c960240da |
children | 7785:cdffbda59b03 |
files | core/sessionmanager.lua plugins/mod_saslauth.lua |
diffstat | 2 files changed, 5 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/core/sessionmanager.lua Tue Dec 13 21:25:11 2016 +0100 +++ b/core/sessionmanager.lua Tue Dec 13 18:15:17 2016 +0100 @@ -108,7 +108,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; @@ -176,6 +176,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);
--- a/plugins/mod_saslauth.lua Tue Dec 13 21:25:11 2016 +0100 +++ b/plugins/mod_saslauth.lua Tue Dec 13 18:15:17 2016 +0100 @@ -273,7 +273,7 @@ end end); -module:hook("iq/self/urn:ietf:params:xml:ns:xmpp-bind:bind", function(event) +module:hook("stanza/iq/urn:ietf:params:xml:ns:xmpp-bind:bind", function(event) local origin, stanza = event.origin, event.stanza; local resource; if stanza.attr.type == "set" then