mod_invites: Prefer landing page over xmpp URI in shell command 0.12
authorKim Alvefur <zash@zash.se>
Tue, 10 Jan 2023 21:10:58 +0100
branch0.12
changeset 12838 dcbff9f038a0
parent 12835 1cdaf21584da
child 12839 6a97d448cb1e
child 12846 3edd39c55a8a
mod_invites: Prefer landing page over xmpp URI in shell command To mirror behavior of prosodyctl invocation
plugins/mod_invites.lua
--- a/plugins/mod_invites.lua	Sun Jan 08 13:35:04 2023 +0100
+++ b/plugins/mod_invites.lua	Tue Jan 10 21:10:58 2023 +0100
@@ -217,7 +217,7 @@
 		if not mod_invites then return nil, err or "mod_invites not loaded on this host"; end
 		local invite, err = mod_invites.create_account(username);
 		if not invite then return nil, err; end
-		return true, invite.uri;
+		return true, invite.landing_page or invite.uri;
 	end
 
 	function console_env.invite:create_contact(user_jid, allow_registration)
@@ -226,7 +226,7 @@
 		if not mod_invites then return nil, err or "mod_invites not loaded on this host"; end
 		local invite, err = mod_invites.create_contact(username, allow_registration);
 		if not invite then return nil, err; end
-		return true, invite.uri;
+		return true, invite.landing_page or invite.uri;
 	end
 end