comparison mod_adhoc/adhoc/adhoc.lib.lua @ 37:6018c0370d89

merge
author Thilo Cestonaro <thilo@cestona.ro>
date Mon, 12 Oct 2009 23:09:21 +0200
parents 58d326d86a9a
children adc9eff8adb2
comparison
equal deleted inserted replaced
31:a0dfa3e5883c 37:6018c0370d89
1 local st = require "util.stanza";
2
3 local xmlns_cmd = "http://jabber.org/protocol/commands";
4
5 local _M = {};
6
7 function _cmdtag(desc, status, sessionid, action)
8 local cmd = st.stanza("command", { xmlns = xmlns_cmd, node = desc.node, status = status });
9 if sessionid then cmd.attr.sessionid = sessionid; end
10 if action then cmd.attr.action = action; end
11
12 return cmd;
13 end
14
15 function _M.new(name, node, handler)
16 return { name = name, node = node, handler = handler, cmdtag = _cmdtag };
17 end
18
19 return _M;