summary refs log tree commit diff
path: root/src/api
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-12-17 18:45:42 +1100
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-12-17 18:45:42 +1100
commit444e81569018a71a1e50deef37419c4a2b10f3ef (patch)
treefefec776056da164b39f7165494b81e5667f41f8 /src/api
parentRemove /api/-/monitorz (diff)
downloadserver-444e81569018a71a1e50deef37419c4a2b10f3ef.tar.xz
Remove bad banned words implementation
Diffstat (limited to 'src/api')
-rw-r--r--src/api/Server.ts3
-rw-r--r--src/api/routes/channels/#channel_id/messages/#message_id/index.ts5
-rw-r--r--src/api/routes/channels/#channel_id/messages/index.ts5
3 files changed, 1 insertions, 12 deletions
diff --git a/src/api/Server.ts b/src/api/Server.ts
index c7e53d70..b8d1f9f6 100644
--- a/src/api/Server.ts
+++ b/src/api/Server.ts
@@ -1,7 +1,7 @@
 import "missing-native-js-functions";
 import { Server, ServerOptions } from "lambert-server";
 import { Authentication, CORS } from "./middlewares/";
-import { BannedWords, Config, initDatabase, initEvent } from "@fosscord/util";
+import { Config, initDatabase, initEvent } from "@fosscord/util";
 import { ErrorHandler } from "./middlewares/ErrorHandler";
 import { BodyParser } from "./middlewares/BodyParser";
 import { Router, Request, Response, NextFunction } from "express";
@@ -38,7 +38,6 @@ export class FosscordServer extends Server {
 		await Config.init();
 		await initEvent();
 		await initInstance();
-		await BannedWords.init();
 
 		let logRequests = process.env["LOG_REQUESTS"] != undefined;
 		if (logRequests) {
diff --git a/src/api/routes/channels/#channel_id/messages/#message_id/index.ts b/src/api/routes/channels/#channel_id/messages/#message_id/index.ts
index 6fccac30..cd9da184 100644
--- a/src/api/routes/channels/#channel_id/messages/#message_id/index.ts
+++ b/src/api/routes/channels/#channel_id/messages/#message_id/index.ts
@@ -12,7 +12,6 @@ import {
 	Snowflake,
 	uploadFile,
 	MessageCreateSchema,
-	BannedWords,
 	DiscordApiErrors,
 } from "@fosscord/util";
 import { Router, Response, Request } from "express";
@@ -44,10 +43,6 @@ router.patch(
 		const { message_id, channel_id } = req.params;
 		var body = req.body as MessageCreateSchema;
 
-		if (body.content)
-			if (BannedWords.find(body.content))
-				throw DiscordApiErrors.AUTOMODERATOR_BLOCK;
-
 		const message = await Message.findOneOrFail({
 			where: { id: message_id, channel_id },
 			relations: ["attachments"],
diff --git a/src/api/routes/channels/#channel_id/messages/index.ts b/src/api/routes/channels/#channel_id/messages/index.ts
index ecbd1b19..4b935f19 100644
--- a/src/api/routes/channels/#channel_id/messages/index.ts
+++ b/src/api/routes/channels/#channel_id/messages/index.ts
@@ -15,7 +15,6 @@ import {
 	Role,
 	MessageCreateSchema,
 	ReadState,
-	BannedWords,
 	DiscordApiErrors,
 } from "@fosscord/util";
 import { HTTPError } from "lambert-server";
@@ -192,10 +191,6 @@ router.post(
 		var body = req.body as MessageCreateSchema;
 		const attachments: Attachment[] = [];
 
-		if (body.content)
-			if (BannedWords.find(body.content))
-				throw DiscordApiErrors.AUTOMODERATOR_BLOCK;
-
 		const channel = await Channel.findOneOrFail({
 			where: { id: channel_id },
 			relations: ["recipients", "recipients.user"],