From 321bd24b98c73ededc9713001a64db0dc55c4e68 Mon Sep 17 00:00:00 2001 From: Johann150 Date: Mon, 20 Jun 2022 21:03:26 +0200 Subject: [PATCH] api: handle muting notification types --- .../server/api/endpoints/notes/thread-muting/create.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/backend/src/server/api/endpoints/notes/thread-muting/create.ts b/packages/backend/src/server/api/endpoints/notes/thread-muting/create.ts index 4154b5dc5..3181041a8 100644 --- a/packages/backend/src/server/api/endpoints/notes/thread-muting/create.ts +++ b/packages/backend/src/server/api/endpoints/notes/thread-muting/create.ts @@ -1,3 +1,4 @@ +import { noteNotificationTypes } from 'foundkey-js'; import { Notes, NoteThreadMutings } from '@/models/index.js'; import { genId } from '@/misc/gen-id.js'; import readNote from '@/services/note/read.js'; @@ -25,6 +26,14 @@ export const paramDef = { type: 'object', properties: { noteId: { type: 'string', format: 'misskey:id' }, + mutingNotificationTypes: { + description: 'Defines which notification types from the thread should be muted. Replies are always muted. Applies in addition to the global settings, muting takes precedence.', + type: 'array', + items: { + type: 'string', enum: noteNotificationTypes, + }, + uniqueItems: true, + }, }, required: ['noteId'], } as const; @@ -51,5 +60,6 @@ export default define(meta, paramDef, async (ps, user) => { createdAt: new Date(), threadId: note.threadId || note.id, userId: user.id, + mutingNotificationTypes: ps.mutingNotificationTypes, }); });