# HG changeset patch # User Kim Alvefur # Date 1622568212 -7200 # Node ID 3e2e708fd18b0211df5527af02988f9d18fd6711 # Parent 785389a2d2b3cf225e1d8024f387c20dfb59e61e 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. diff -r 785389a2d2b3 -r 3e2e708fd18b mod_adhoc_dataforms_demo/mod_adhoc_dataforms_demo.lua --- 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));