Mercurial > prosody-hg
comparison plugins/mod_invites.lua @ 14082:13b3220c3282
mod_invites: Add 'reusable' parameter to create_account() and create_contact()
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Mon, 16 Feb 2026 17:55:08 +0000 |
| parents | 42e035cd3322 |
| children | 486d42764da9 |
comparison
equal
deleted
inserted
replaced
| 14081:7c9fd032c788 | 14082:13b3220c3282 |
|---|---|
| 75 | 75 |
| 76 return invite; | 76 return invite; |
| 77 end | 77 end |
| 78 | 78 |
| 79 -- Create invitation to register an account (optionally restricted to the specified username) | 79 -- Create invitation to register an account (optionally restricted to the specified username) |
| 80 function create_account(account_username, additional_data, ttl) --luacheck: ignore 131/create_account | 80 function create_account(account_username, additional_data, ttl, reusable) --luacheck: ignore 131/create_account |
| 81 local jid = account_username and (account_username.."@"..module.host) or module.host; | 81 local jid = account_username and (account_username.."@"..module.host) or module.host; |
| 82 return create_invite("register", jid, true, additional_data, ttl); | 82 return create_invite("register", jid, true, additional_data, ttl, reusable); |
| 83 end | 83 end |
| 84 | 84 |
| 85 -- Create invitation to reset the password for an account | 85 -- Create invitation to reset the password for an account |
| 86 function create_account_reset(account_username, ttl) --luacheck: ignore 131/create_account_reset | 86 function create_account_reset(account_username, ttl) --luacheck: ignore 131/create_account_reset |
| 87 return create_account(account_username, { allow_reset = account_username }, ttl or 86400); | 87 return create_account(account_username, { allow_reset = account_username }, ttl or 86400); |
| 88 end | 88 end |
| 89 | 89 |
| 90 -- Create invitation to become a contact of a local user | 90 -- Create invitation to become a contact of a local user |
| 91 function create_contact(username, allow_registration, additional_data, ttl) --luacheck: ignore 131/create_contact | 91 function create_contact(username, allow_registration, additional_data, ttl, reusable) --luacheck: ignore 131/create_contact |
| 92 return create_invite("roster", username.."@"..module.host, allow_registration, additional_data, ttl); | 92 return create_invite("roster", username.."@"..module.host, allow_registration, additional_data, ttl, reusable); |
| 93 end | 93 end |
| 94 | 94 |
| 95 -- Create invitation to register an account and join a user group | 95 -- Create invitation to register an account and join a user group |
| 96 -- If explicit ttl is passed, invite is valid for multiple signups | 96 -- If explicit ttl is passed, invite is valid for multiple signups |
| 97 -- during that time period | 97 -- during that time period |
