MUC: Don't limit affiliation changes to owners, and allow owners to remove themselves...
[prosody.git] / plugins / adhoc / adhoc.lib.lua
index 853992e06ef9e5ccbba414894f3477dccbb4039b..0cb4efe1097c06b4bfe6f32384bd9ed348367844 100644 (file)
@@ -1,3 +1,9 @@
+-- Copyright (C) 2009-2010 Florian Zeitz
+--
+-- This file is MIT/X11 licensed. Please see the
+-- COPYING file in the source package for more information.
+--
+
 local st, uuid = require "util.stanza", require "util.uuid";
 
 local xmlns_cmd = "http://jabber.org/protocol/commands";
@@ -40,7 +46,7 @@ function _M.handle_cmd(command, origin, stanza)
                stanza = st.error_reply(stanza, data.error.type, data.error.condition, data.error.message);
                origin.send(stanza);
                return true;
-       else 
+       else
                cmdtag = command:cmdtag("executing", sessionid);
        end
 
@@ -63,9 +69,9 @@ function _M.handle_cmd(command, origin, stanza)
                        end
                        cmdtag:add_child(actions);
                elseif name == "form" then
-                       cmdtag:add_child(content:form());
+                       cmdtag:add_child((content.layout or content):form(content.values));
                elseif name == "result" then
-                       cmdtag:add_child(content.layout:form(content.data, "result"));
+                       cmdtag:add_child((content.layout or content):form(content.values, "result"));
                elseif name == "other" then
                        cmdtag:add_child(content);
                end