Merge branch 'fosscord:master' into master

This commit is contained in:
Featyre
2022-01-23 15:57:00 +00:00
committed by GitHub
12 changed files with 7 additions and 6 deletions

BIN
api/package-lock.json generated

Binary file not shown.

View File

@@ -86,7 +86,7 @@
"missing-native-js-functions": "^1.2.18",
"morgan": "^1.10.0",
"multer": "^1.4.2",
"node-fetch": "^2.6.1",
"node-fetch": "^3.1.1",
"patch-package": "^6.4.7",
"picocolors": "^1.0.0",
"proxy-agent": "^5.0.0",

Binary file not shown.

View File

@@ -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);