215 local username, host = jid_split(user_jid); |
215 local username, host = jid_split(user_jid); |
216 local mod_invites, err = get_module(host, "invites"); |
216 local mod_invites, err = get_module(host, "invites"); |
217 if not mod_invites then return nil, err or "mod_invites not loaded on this host"; end |
217 if not mod_invites then return nil, err or "mod_invites not loaded on this host"; end |
218 local invite, err = mod_invites.create_account(username); |
218 local invite, err = mod_invites.create_account(username); |
219 if not invite then return nil, err; end |
219 if not invite then return nil, err; end |
220 return true, invite.uri; |
220 return true, invite.landing_page or invite.uri; |
221 end |
221 end |
222 |
222 |
223 function console_env.invite:create_contact(user_jid, allow_registration) |
223 function console_env.invite:create_contact(user_jid, allow_registration) |
224 local username, host = jid_split(user_jid); |
224 local username, host = jid_split(user_jid); |
225 local mod_invites, err = get_module(host, "invites"); |
225 local mod_invites, err = get_module(host, "invites"); |
226 if not mod_invites then return nil, err or "mod_invites not loaded on this host"; end |
226 if not mod_invites then return nil, err or "mod_invites not loaded on this host"; end |
227 local invite, err = mod_invites.create_contact(username, allow_registration); |
227 local invite, err = mod_invites.create_contact(username, allow_registration); |
228 if not invite then return nil, err; end |
228 if not invite then return nil, err; end |
229 return true, invite.uri; |
229 return true, invite.landing_page or invite.uri; |
230 end |
230 end |
231 end |
231 end |
232 |
232 |
233 --- prosodyctl command |
233 --- prosodyctl command |
234 function module.command(arg) |
234 function module.command(arg) |