Comparison

core/stanza_router.lua @ 2918:79ca9f686aaf

stanza_router: Don't send error replies for stanzas of type 'error' and 'result' on unbound authenticated connections. [originally fa84451e9b35 in 0.6]
author Waqas Hussain <waqas20@gmail.com>
date Mon, 22 Mar 2010 15:05:05 +0000
parent 2917:2a6552b22f01
child 2925:692b3c6c5bd2
comparison
equal deleted inserted replaced
2917:2a6552b22f01 2918:79ca9f686aaf
39 if origin.type == "c2s" and stanza.attr.xmlns == "jabber:client" then 39 if origin.type == "c2s" and stanza.attr.xmlns == "jabber:client" then
40 if not origin.full_jid 40 if not origin.full_jid
41 and not(stanza.name == "iq" and stanza.attr.type == "set" and stanza.tags[1] and stanza.tags[1].name == "bind" 41 and not(stanza.name == "iq" and stanza.attr.type == "set" and stanza.tags[1] and stanza.tags[1].name == "bind"
42 and stanza.tags[1].attr.xmlns == "urn:ietf:params:xml:ns:xmpp-bind") then 42 and stanza.tags[1].attr.xmlns == "urn:ietf:params:xml:ns:xmpp-bind") then
43 -- authenticated client isn't bound and current stanza is not a bind request 43 -- authenticated client isn't bound and current stanza is not a bind request
44 origin.send(st.error_reply(stanza, "auth", "not-authorized")); -- FIXME maybe allow stanzas to account or server 44 if stanza.attr.type ~= "result" and stanza.attr.type ~= "error" then
45 origin.send(st.error_reply(stanza, "auth", "not-authorized")); -- FIXME maybe allow stanzas to account or server
46 end
45 return; 47 return;
46 end 48 end
47 49
48 -- TODO also, stanzas should be returned to their original state before the function ends 50 -- TODO also, stanzas should be returned to their original state before the function ends
49 stanza.attr.from = origin.full_jid; 51 stanza.attr.from = origin.full_jid;