This commit is contained in:
Bryan1029384756
2026-04-18 15:41:51 -05:00
parent 938df217f4
commit 593eaba82e
47 changed files with 3539 additions and 212 deletions

View File

@@ -3,6 +3,7 @@ import { paginationOptsValidator } from "convex/server";
import { v } from "convex/values";
import { getPublicStorageUrl } from "./storageUrl";
import { getRolesForUser } from "./roles";
import { isBanned } from "./bans";
const DEFAULT_ROLE_COLOR = "#99aab5";
@@ -252,6 +253,9 @@ export const sendInternal = internalMutation({
if (args.ciphertext.length > MAX_CIPHERTEXT_CHARS) {
throw new Error("Message too large");
}
if (await isBanned(ctx, args.senderId)) {
throw new Error("You've been banned from this server.");
}
const id = await ctx.db.insert("messages", {
channelId: args.channelId,
senderId: args.senderId,