comparison mod_adhoc/adhoc/adhoc.lib.lua @ 149:b8a89ebf71e3

mod_adhoc: default action is "execute"
author Florian Zeitz < florob@babelmonkeys.de>
date Thu, 15 Apr 2010 23:57:07 +0200
parents 843cadf36306
children b3a68e71b8a1
comparison
equal deleted inserted replaced
148:f2f9b965d1ad 149:b8a89ebf71e3
21 function _M.handle_cmd(command, origin, stanza) 21 function _M.handle_cmd(command, origin, stanza)
22 local sessionid = stanza.tags[1].attr.sessionid or uuid.generate(); 22 local sessionid = stanza.tags[1].attr.sessionid or uuid.generate();
23 local dataIn = {}; 23 local dataIn = {};
24 dataIn.to = stanza.attr.to; 24 dataIn.to = stanza.attr.to;
25 dataIn.from = stanza.attr.from; 25 dataIn.from = stanza.attr.from;
26 dataIn.action = stanza.tags[1].attr.action or nil; 26 dataIn.action = stanza.tags[1].attr.action or "execute";
27 dataIn.form = stanza.tags[1]:child_with_ns("jabber:x:data"); 27 dataIn.form = stanza.tags[1]:child_with_ns("jabber:x:data");
28 28
29 local data, state = command:handler(dataIn, states[sessionid]); 29 local data, state = command:handler(dataIn, states[sessionid]);
30 states[sessionid] = state; 30 states[sessionid] = state;
31 local stanza = st.reply(stanza); 31 local stanza = st.reply(stanza);