Changeset

7951:2b91da49285a

mod_adhoc/adhoc.lib: instantiate table with all fields
author Kim Alvefur <zash@zash.se>
date Mon, 06 Mar 2017 15:09:22 +0100
parents 7949:8acc35b5355a
children 7952:38053bf1630d
files plugins/adhoc/adhoc.lib.lua
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/adhoc/adhoc.lib.lua	Sat Mar 04 20:09:28 2017 +0100
+++ b/plugins/adhoc/adhoc.lib.lua	Mon Mar 06 15:09:22 2017 +0100
@@ -27,11 +27,12 @@
 function _M.handle_cmd(command, origin, stanza)
 	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 = cmdtag.attr.action or "execute";
-	dataIn.form = cmdtag:get_child("x", "jabber:x:data");
+	local dataIn = {
+		to = stanza.attr.to;
+		from = stanza.attr.from;
+		action = cmdtag.attr.action or "execute";
+		form = cmdtag:get_child("x", "jabber:x:data");
+	};
 
 	local data, state = command:handler(dataIn, states[sessionid]);
 	states[sessionid] = state;