diff options
author | Waqas Hussain <waqas20@gmail.com> | 2009-06-20 17:51:00 +0500 |
---|---|---|
committer | Waqas Hussain <waqas20@gmail.com> | 2009-06-20 17:51:00 +0500 |
commit | 2c226d62190343bfbc4b8cdaffc51bae67a358f3 (patch) | |
tree | 59b7a43a1638cfceb938729ea27a66afbc51658c /core/stanza_router.lua | |
parent | 50c7a5297cc2fea88ddf9d3ba944546d12383500 (diff) | |
download | prosody-2c226d62190343bfbc4b8cdaffc51bae67a358f3.tar.gz prosody-2c226d62190343bfbc4b8cdaffc51bae67a358f3.zip |
stanza_router: A little refactoring
Diffstat (limited to 'core/stanza_router.lua')
-rw-r--r-- | core/stanza_router.lua | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/core/stanza_router.lua b/core/stanza_router.lua index cf4257c5..78ebb7f3 100644 --- a/core/stanza_router.lua +++ b/core/stanza_router.lua @@ -48,15 +48,15 @@ function core_process_stanza(origin, stanza) end end - if origin.type == "c2s" and not origin.full_jid - and not(stanza.name == "iq" and stanza.attr.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 - origin.send(st.error_reply(stanza, "auth", "not-authorized")); -- FIXME maybe allow stanzas to account or server - end - - -- TODO also, stanzas should be returned to their original state before the function ends if origin.type == "c2s" then + if not origin.full_jid + and not(stanza.name == "iq" and stanza.attr.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 + origin.send(st.error_reply(stanza, "auth", "not-authorized")); -- FIXME maybe allow stanzas to account or server + end + + -- TODO also, stanzas should be returned to their original state before the function ends stanza.attr.from = origin.full_jid; end local to, xmlns = stanza.attr.to, stanza.attr.xmlns; |