aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_proxy65.lua
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2010-12-03 00:22:11 +0500
committerWaqas Hussain <waqas20@gmail.com>2010-12-03 00:22:11 +0500
commitc7a7538ac0b5966387e4680db72a71027b81be7e (patch)
tree40a54c3ec5481ef02bf5c79854eda35e052046d3 /plugins/mod_proxy65.lua
parent21e7290e0146868e490de53e52f2ff0d6cd62b7b (diff)
downloadprosody-c7a7538ac0b5966387e4680db72a71027b81be7e.tar.gz
prosody-c7a7538ac0b5966387e4680db72a71027b81be7e.zip
mod_proxy65: Cleaned up stanza processing a little.
Diffstat (limited to 'plugins/mod_proxy65.lua')
-rw-r--r--plugins/mod_proxy65.lua15
1 files changed, 6 insertions, 9 deletions
diff --git a/plugins/mod_proxy65.lua b/plugins/mod_proxy65.lua
index 565cb38f..6fc12554 100644
--- a/plugins/mod_proxy65.lua
+++ b/plugins/mod_proxy65.lua
@@ -192,15 +192,12 @@ module.unload = function()
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});