summary refs log tree commit diff
path: root/api/src/routes/invites
diff options
context:
space:
mode:
authorFeatyre <88265031+Featyre@users.noreply.github.com>2022-01-23 15:57:00 +0000
committerGitHub <noreply@github.com>2022-01-23 15:57:00 +0000
commitcaa951b318bc0e8d2e4e5e6038972f2abfa603ce (patch)
tree388f9319bce4fd8556a1371a6af117cf2afd8dc8 /api/src/routes/invites
parentPartial integration of categories and discovery (diff)
parentClosed-join guilds (diff)
downloadserver-caa951b318bc0e8d2e4e5e6038972f2abfa603ce.tar.xz
Merge branch 'fosscord:master' into master
Diffstat (limited to 'api/src/routes/invites')
-rw-r--r--api/src/routes/invites/index.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/api/src/routes/invites/index.ts b/api/src/routes/invites/index.ts
index ac813126..37e9e05a 100644
--- a/api/src/routes/invites/index.ts
+++ b/api/src/routes/invites/index.ts
@@ -19,7 +19,8 @@ router.post("/:code", route({}), async (req: Request, res: Response) => {
 	const { features } = await Guild.findOneOrFail({ id: guild_id});
 	const { public_flags } = await User.findOneOrFail({ id: req.user_id });
 	
-	if(features.includes("INTERNAL_EMPLOYEE_ONLY") && (public_flags & 1) !== 1) throw new HTTPError("The Maze isn't meant for you.", 401)
+	if(features.includes("INTERNAL_EMPLOYEE_ONLY") && (public_flags & 1) !== 1) throw new HTTPError("Only intended for the staff of this server.", 401);
+	if(features.includes("INVITES_CLOSED")) throw new HTTPError("Sorry, this guild has joins closed.", 403);
 	
 	const invite = await Invite.joinGuild(req.user_id, code);