Better Chat
All checks were successful
Build and Release / build-and-release (push) Successful in 11m38s

This commit is contained in:
Bryan1029384756
2026-02-17 10:12:38 -06:00
parent 9162ca7c94
commit bebf0bf989
11 changed files with 1142 additions and 201 deletions

View File

@@ -113,6 +113,26 @@ export const send = mutation({
},
});
export const sendBatch = mutation({
args: {
messages: v.array(v.object({
channelId: v.id("channels"),
senderId: v.id("userProfiles"),
ciphertext: v.string(),
nonce: v.string(),
signature: v.string(),
keyVersion: v.number(),
})),
},
returns: v.object({ count: v.number() }),
handler: async (ctx, args) => {
for (const msg of args.messages) {
await ctx.db.insert("messages", { ...msg });
}
return { count: args.messages.length };
},
});
export const edit = mutation({
args: {
id: v.id("messages"),