v3: added a chatbox
Some checks failed
Build and Publish Docker Image / build-and-push (push) Has been cancelled
Some checks failed
Build and Publish Docker Image / build-and-push (push) Has been cancelled
This commit is contained in:
@@ -235,10 +235,13 @@ export function notifyDumpOwnerUpvote(
|
||||
export function notifyMentions(
|
||||
mentionerUserId: string,
|
||||
body: string,
|
||||
contextType: "comment" | "dump" | "playlist",
|
||||
contextType: "comment" | "dump" | "playlist" | "chat",
|
||||
contextId: string,
|
||||
contextTitle: string,
|
||||
dumpId?: string,
|
||||
// Optional: skip notifying a mentioned user (e.g. they're already reading the
|
||||
// chat live, so the persistent notification would be redundant).
|
||||
skipUserId?: (userId: string) => boolean,
|
||||
): void {
|
||||
const mentionerRow = db.prepare(
|
||||
`SELECT username FROM users WHERE id = ?;`,
|
||||
@@ -256,6 +259,7 @@ export function notifyMentions(
|
||||
`SELECT id FROM users WHERE lower(username) = ?;`,
|
||||
).get(username) as { id: string } | undefined;
|
||||
if (!mentionedRow || mentionedRow.id === mentionerUserId) continue;
|
||||
if (skipUserId?.(mentionedRow.id)) continue;
|
||||
|
||||
createNotification(
|
||||
mentionedRow.id,
|
||||
|
||||
Reference in New Issue
Block a user