Comparison

mod_adhoc_dataforms_demo/mod_adhoc_dataforms_demo.lua @ 4581:3e2e708fd18b

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.
author Kim Alvefur <zash@zash.se>
date Tue, 01 Jun 2021 19:23:32 +0200
parent 4050:1eb2b9483081
comparison
equal deleted inserted replaced
4580:785389a2d2b3 4581:3e2e708fd18b
178 table.insert(next_step.actions, 1, "prev"); 178 table.insert(next_step.actions, 1, "prev");
179 end 179 end
180 return next_step, state; 180 return next_step, state;
181 end 181 end
182 182
183 local permission = "any";
184 if not module.send_iq then -- hacky attempt at detecting 0.11 or earlier
185 permission = "user";
186 end
187
183 module:depends("adhoc"); 188 module:depends("adhoc");
184 module:provides("adhoc", 189 module:provides("adhoc",
185 adhoc_new("Multi-step command demo", 190 adhoc_new("Multi-step command demo",
186 "xmpp:zash.se/mod_adhoc_dataforms_demo#multi", 191 "xmpp:zash.se/mod_adhoc_dataforms_demo#multi",
187 multi_step_command, "any")); 192 multi_step_command, permission));
188 193