v3: correctly using SITE_NAME across the app, added notifications on comments
All checks were successful
Build and Publish Docker Image / build-and-push (push) Successful in 44s
All checks were successful
Build and Publish Docker Image / build-and-push (push) Successful in 44s
This commit is contained in:
@@ -276,6 +276,36 @@ export function notifyMentions(
|
||||
}
|
||||
}
|
||||
|
||||
export function notifyDumpOwnerNewComment(
|
||||
commenterId: string,
|
||||
commentId: string,
|
||||
dumpId: string,
|
||||
): void {
|
||||
const commenterRow = db.prepare(
|
||||
`SELECT username FROM users WHERE id = ?;`,
|
||||
).get(commenterId) as { username: string } | undefined;
|
||||
|
||||
const dumpRow = db.prepare(
|
||||
`SELECT title, user_id FROM dumps WHERE id = ?;`,
|
||||
).get(dumpId) as { title: string; user_id: string } | undefined;
|
||||
|
||||
if (!commenterRow || !dumpRow) return;
|
||||
if (commenterId === dumpRow.user_id) return; // no self-notification
|
||||
|
||||
createNotification(
|
||||
dumpRow.user_id,
|
||||
"dump_commented",
|
||||
{
|
||||
commenterId,
|
||||
commenterUsername: commenterRow.username,
|
||||
commentId,
|
||||
dumpId,
|
||||
dumpTitle: dumpRow.title,
|
||||
},
|
||||
`comment:${commentId}`,
|
||||
);
|
||||
}
|
||||
|
||||
export function notifyPlaylistFollowersNewDump(
|
||||
playlistId: string,
|
||||
playlistTitle: string,
|
||||
|
||||
Reference in New Issue
Block a user