mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-23 20:49:06 +01:00
Pass reference to Note OBJ when creating notifications for Poll Vote and Poll End so muted threads can be resolved correctly and do not notify if voter is silenced
This commit is contained in:
parent
2660424429
commit
fe05ceca1f
@ -28,6 +28,7 @@ export async function endedPollNotification(
|
|||||||
|
|
||||||
for (const userId of userIds) {
|
for (const userId of userIds) {
|
||||||
createNotification(userId, "pollEnded", {
|
createNotification(userId, "pollEnded", {
|
||||||
|
note: note,
|
||||||
noteId: note.id,
|
noteId: note.id,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ export async function createNotification(
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
data.notifierId &&
|
data.notifierId &&
|
||||||
["mention", "reply", "renote", "quote", "reaction", "bite"].includes(type)
|
["mention", "reply", "renote", "quote", "reaction", "bite", "pollVote"].includes(type)
|
||||||
) {
|
) {
|
||||||
const notifier = await Users.findOneBy({ id: data.notifierId });
|
const notifier = await Users.findOneBy({ id: data.notifierId });
|
||||||
// suppress if the notifier does not exist or is silenced.
|
// suppress if the notifier does not exist or is silenced.
|
||||||
|
@ -67,6 +67,7 @@ export default async function (
|
|||||||
// Notify
|
// Notify
|
||||||
createNotification(note.userId, "pollVote", {
|
createNotification(note.userId, "pollVote", {
|
||||||
notifierId: user.id,
|
notifierId: user.id,
|
||||||
|
note: note,
|
||||||
noteId: note.id,
|
noteId: note.id,
|
||||||
choice: choice,
|
choice: choice,
|
||||||
});
|
});
|
||||||
@ -79,6 +80,7 @@ export default async function (
|
|||||||
for (const watcher of watchers) {
|
for (const watcher of watchers) {
|
||||||
createNotification(watcher.userId, "pollVote", {
|
createNotification(watcher.userId, "pollVote", {
|
||||||
notifierId: user.id,
|
notifierId: user.id,
|
||||||
|
note: note,
|
||||||
noteId: note.id,
|
noteId: note.id,
|
||||||
choice: choice,
|
choice: choice,
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user