view mod_adhoc/adhoc/adhoc.lib.lua @ 41:0381d5d38c37

mod_privacy: fix bug where priority was nil and compared to a number (Thx flo for reporting!)
author Thilo Cestonaro <thilo@cestona.ro>
date Thu, 15 Oct 2009 09:41:13 +0200
parents 58d326d86a9a
children adc9eff8adb2
line wrap: on
line source

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;