plugins/mod_invites.lua
branch0.12
changeset 12838 dcbff9f038a0
parent 12155 669d93f1db6a
child 12981 74b9e05af71e
equal deleted inserted replaced
12835:1cdaf21584da 12838:dcbff9f038a0
   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)