Software /
code /
prosody
Comparison
plugins/mod_invites.lua @ 12835:6a97d448cb1e
Merge 0.12->trunk
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Tue, 10 Jan 2023 21:14:07 +0100 |
parent | 12834:dcbff9f038a0 |
child | 12977:74b9e05af71e |
comparison
equal
deleted
inserted
replaced
12833:8cbb109ff7ec | 12835:6a97d448cb1e |
---|---|
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) |