# HG changeset patch # User Waqas Hussain <waqas20@gmail.com> # Date 1291317731 -18000 # Node ID 519f5eadf4b9d998735931e64d43148698d9940f # Parent 117778c5a7fe5df10ca03b5017ffb75f1a5af75c mod_proxy65: Cleaned up stanza processing a little. diff -r 117778c5a7fe -r 519f5eadf4b9 plugins/mod_proxy65.lua --- a/plugins/mod_proxy65.lua Fri Dec 03 00:21:49 2010 +0500 +++ b/plugins/mod_proxy65.lua Fri Dec 03 00:22:11 2010 +0500 @@ -192,15 +192,12 @@ end local function set_activation(stanza) - local from, to, sid, reply = nil; - from = stanza.attr.from; - if stanza.tags[1] ~= nil and tostring(stanza.tags[1].name) == "query" then - if stanza.tags[1].attr ~= nil then - sid = stanza.tags[1].attr.sid; - end - if stanza.tags[1].tags[1] ~= nil and tostring(stanza.tags[1].tags[1].name) == "activate" then - to = stanza.tags[1].tags[1][1]; - end + local to, reply; + local from = stanza.attr.from; + local query = stanza.tags[1]; + local sid = query.attr.sid; + if query.tags[1] and query.tags[1].name == "activate" then + to = query.tags[1][1]; end if from ~= nil and to ~= nil and sid ~= nil then reply = st.iq({type="result", from=host, to=from});