aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/adhoc
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2014-07-04 23:05:27 +0200
committerKim Alvefur <zash@zash.se>2014-07-04 23:05:27 +0200
commit4ee00880c225db985b26614eeb0b3d0d39487c99 (patch)
tree41f4db74c0b05563f71d07478a4d8b3c106359af /plugins/adhoc
parent6c75e23434fd4ba3eed580582ade3ad8337fd585 (diff)
parent260fc78e4095f1e4ed74d4e76dc1eb23713bacf1 (diff)
downloadprosody-4ee00880c225db985b26614eeb0b3d0d39487c99.tar.gz
prosody-4ee00880c225db985b26614eeb0b3d0d39487c99.zip
Merge 0.10->trunk
Diffstat (limited to 'plugins/adhoc')
-rw-r--r--plugins/adhoc/adhoc.lib.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/adhoc/adhoc.lib.lua b/plugins/adhoc/adhoc.lib.lua
index b544ddc8..5c90c91b 100644
--- a/plugins/adhoc/adhoc.lib.lua
+++ b/plugins/adhoc/adhoc.lib.lua
@@ -25,12 +25,13 @@ function _M.new(name, node, handler, permission)
end
function _M.handle_cmd(command, origin, stanza)
- local sessionid = stanza.tags[1].attr.sessionid or uuid.generate();
+ local cmdtag = stanza.tags[1]
+ local sessionid = cmdtag.attr.sessionid or uuid.generate();
local dataIn = {};
dataIn.to = stanza.attr.to;
dataIn.from = stanza.attr.from;
- dataIn.action = stanza.tags[1].attr.action or "execute";
- dataIn.form = stanza.tags[1]:child_with_ns("jabber:x:data");
+ dataIn.action = cmdtag.attr.action or "execute";
+ dataIn.form = cmdtag:get_child("x", "jabber:x:data");
local data, state = command:handler(dataIn, states[sessionid]);
states[sessionid] = state;