comparison mod_invites/mod_invites.lua @ 4078:2f0c8670d2fa

mod_invites: Add API to create account reset invites (from Snikket)
author Matthew Wild <mwild1@gmail.com>
date Mon, 07 Sep 2020 13:00:43 +0100
parents f85ea76447dd
children b68b917e568f
comparison
equal deleted inserted replaced
4077:f85ea76447dd 4078:2f0c8670d2fa
60 60
61 -- Create invitation to register an account (optionally restricted to the specified username) 61 -- Create invitation to register an account (optionally restricted to the specified username)
62 function create_account(account_username, additional_data) --luacheck: ignore 131/create_account 62 function create_account(account_username, additional_data) --luacheck: ignore 131/create_account
63 local jid = account_username and (account_username.."@"..module.host) or module.host; 63 local jid = account_username and (account_username.."@"..module.host) or module.host;
64 return create_invite("register", jid, true, additional_data); 64 return create_invite("register", jid, true, additional_data);
65 end
66
67 -- Create invitation to reset the password for an account
68 function create_account_reset(account_username) --luacheck: ignore 131/create_account_reset
69 return create_account(account_username, { allow_reset = account_username });
65 end 70 end
66 71
67 -- Create invitation to become a contact of a local user 72 -- Create invitation to become a contact of a local user
68 function create_contact(username, allow_registration, additional_data) --luacheck: ignore 131/create_contact 73 function create_contact(username, allow_registration, additional_data) --luacheck: ignore 131/create_contact
69 return create_invite("roster", username.."@"..module.host, allow_registration, additional_data); 74 return create_invite("roster", username.."@"..module.host, allow_registration, additional_data);