mod_adhoc_dataforms_demo: Add compat with 0.11 (vs trunk api change)
The name of the "access for anyone" permission level changed from "user"
in 0.11 to "any" in 0.12/trunk to make it clearer that it's basically
unrestricted. This is unfortunately not backwards-compatible.
Thanks to Sam for stumbling upon this during a demo.
--- a/mod_adhoc_dataforms_demo/mod_adhoc_dataforms_demo.lua Sat May 29 15:34:41 2021 +0200
+++ b/mod_adhoc_dataforms_demo/mod_adhoc_dataforms_demo.lua Tue Jun 01 19:23:32 2021 +0200
@@ -180,9 +180,14 @@
return next_step, state;
end
+local permission = "any";
+if not module.send_iq then -- hacky attempt at detecting 0.11 or earlier
+ permission = "user";
+end
+
module:depends("adhoc");
module:provides("adhoc",
adhoc_new("Multi-step command demo",
"xmpp:zash.se/mod_adhoc_dataforms_demo#multi",
- multi_step_command, "any"));
+ multi_step_command, permission));