diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mod_adhoc/adhoc/adhoc.lib.lua	Mon Oct 12 23:09:21 2009 +0200
@@ -0,0 +1,19 @@
+local st = require "util.stanza";
+
+local xmlns_cmd = "http://jabber.org/protocol/commands";
+
+local _M = {};
+
+function _cmdtag(desc, status, sessionid, action)
+	local cmd = st.stanza("command", { xmlns = xmlns_cmd, node = desc.node, status = status });
+	if sessionid then cmd.attr.sessionid = sessionid; end
+	if action then cmd.attr.action = action; end
+
+	return cmd;
+end
+
+function _M.new(name, node, handler)
+	return { name = name, node = node, handler = handler, cmdtag = _cmdtag };
+end
+
+return _M;