comparison plugins/mod_invites.lua @ 13896:17b5a10bd9c9 13.0

mod_invites: Fix --admin to not require a value I have no idea what "kv" means here but this seems to be the way to declare flags that do not take a value in strict mode, which is apparently default for shell-commands.
author Kim Alvefur <zash@zash.se>
date Wed, 18 Jun 2025 15:02:02 +0200
parents c83fdee8efda
children b019a30cc1b2 f0b2a05bcedc
comparison
equal deleted inserted replaced
13894:c6010e1322aa 13896:17b5a10bd9c9
257 { name = "user_jid", type = "string" }; 257 { name = "user_jid", type = "string" };
258 }; 258 };
259 host_selector = "user_jid"; 259 host_selector = "user_jid";
260 flags = { 260 flags = {
261 array_params = { role = true, group = have_group_invites }; 261 array_params = { role = true, group = have_group_invites };
262 value_params = { expires_after = true, admin = true }; 262 value_params = { expires_after = true };
263 kv_params = { admin = true };
263 }; 264 };
264 265
265 handler = function (self, user_jid, opts) --luacheck: ignore 212/self 266 handler = function (self, user_jid, opts) --luacheck: ignore 212/self
266 local username = jid_split(user_jid); 267 local username = jid_split(user_jid);
267 local roles = opts and opts.role or {}; 268 local roles = opts and opts.role or {};