aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/sessionmanager.lua5
-rw-r--r--core/stanza_router.lua10
2 files changed, 4 insertions, 11 deletions
diff --git a/core/sessionmanager.lua b/core/sessionmanager.lua
index 6aa0a4f0..3224a84d 100644
--- a/core/sessionmanager.lua
+++ b/core/sessionmanager.lua
@@ -109,7 +109,7 @@ local function make_authenticated(session, username)
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 @@ local function bind_resource(session, resource)
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);
diff --git a/core/stanza_router.lua b/core/stanza_router.lua
index af797f08..98952faf 100644
--- a/core/stanza_router.lua
+++ b/core/stanza_router.lua
@@ -79,16 +79,6 @@ function core_process_stanza(origin, stanza)
end
end
- if not origin.full_jid
- and not(name == "iq" and st_type == "set" and stanza.tags[1] and stanza.tags[1].name == "bind"
- and stanza.tags[1].attr.xmlns == "urn:ietf:params:xml:ns:xmpp-bind") then
- -- authenticated client isn't bound and current stanza is not a bind request
- if stanza.attr.type ~= "result" and stanza.attr.type ~= "error" then
- origin.send(st.error_reply(stanza, "auth", "not-authorized")); -- FIXME maybe allow stanzas to account or server
- end
- return;
- end
-
-- TODO also, stanzas should be returned to their original state before the function ends
stanza.attr.from = origin.full_jid;
end