Mercurial > prosody-hg
comparison plugins/mod_invites.lua @ 13899:b019a30cc1b2
mod_invites: Switch to new bool_params for util.argparse
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Thu, 19 Jun 2025 11:19:49 +0100 |
| parents | 17b5a10bd9c9 |
| children | 42e035cd3322 |
comparison
equal
deleted
inserted
replaced
| 13898:aac30c5ee334 | 13899:b019a30cc1b2 |
|---|---|
| 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 }; | 262 value_params = { expires_after = true }; |
| 263 kv_params = { admin = true }; | 263 bool_params = { admin = true }; |
| 264 }; | 264 }; |
| 265 | 265 |
| 266 handler = function (self, user_jid, opts) --luacheck: ignore 212/self | 266 handler = function (self, user_jid, opts) --luacheck: ignore 212/self |
| 267 local username = jid_split(user_jid); | 267 local username = jid_split(user_jid); |
| 268 local roles = opts and opts.role or {}; | 268 local roles = opts and opts.role or {}; |
| 324 desc = "Create an invitation to become contacts with the specified user"; | 324 desc = "Create an invitation to become contacts with the specified user"; |
| 325 args = { { name = "user_jid", type = "string" } }; | 325 args = { { name = "user_jid", type = "string" } }; |
| 326 host_selector = "user_jid"; | 326 host_selector = "user_jid"; |
| 327 flags = { | 327 flags = { |
| 328 value_params = { expires_after = true }; | 328 value_params = { expires_after = true }; |
| 329 kv_params = { allow_registration = true }; | 329 bool_params = { allow_registration = true }; |
| 330 }; | 330 }; |
| 331 | 331 |
| 332 handler = function (self, user_jid, opts) --luacheck: ignore 212/self | 332 handler = function (self, user_jid, opts) --luacheck: ignore 212/self |
| 333 local username = jid_split(user_jid); | 333 local username = jid_split(user_jid); |
| 334 if not username then | 334 if not username then |
