From b1e57e571dfd9a7d8b2430294473c2053cc3ea33 Mon Sep 17 00:00:00 2001 From: taichan Date: Tue, 20 Feb 2024 00:52:25 +0900 Subject: [PATCH] =?UTF-8?q?enhance:=20=E9=80=9A=E7=9F=A5=E3=81=8C=E5=87=8D?= =?UTF-8?q?=E7=B5=90=E3=82=82=E8=80=83=E6=85=AE=E3=81=99=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/server/api/endpoints/i/notifications-grouped.ts | 6 ++++-- .../backend/src/server/api/endpoints/i/notifications.ts | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/i/notifications-grouped.ts b/packages/backend/src/server/api/endpoints/i/notifications-grouped.ts index 8adf16294c..eafb1695ba 100644 --- a/packages/backend/src/server/api/endpoints/i/notifications-grouped.ts +++ b/packages/backend/src/server/api/endpoints/i/notifications-grouped.ts @@ -110,7 +110,7 @@ export default class extends Endpoint { // eslint- notifications = notifications.filter(notification => !excludeTypes.includes(notification.type)); } - //#region Check muting + //#region Check muting & suspended const [ userIdsWhoMeMuting, @@ -128,10 +128,12 @@ export default class extends Endpoint { // eslint- if (notifier === null) return null; if (notifier.host && userMutedInstances.has(notifier.host)) return null; + if (notifier.isSuspended) return null; + return notification; }))).filter((notification): notification is MiNotification => notification !== null); - //#endregion Check muting + //#endregion Check muting & suspended if (notifications.length === 0) { return []; diff --git a/packages/backend/src/server/api/endpoints/i/notifications.ts b/packages/backend/src/server/api/endpoints/i/notifications.ts index 0ae8b89d2f..3a2bc819f9 100644 --- a/packages/backend/src/server/api/endpoints/i/notifications.ts +++ b/packages/backend/src/server/api/endpoints/i/notifications.ts @@ -108,7 +108,7 @@ export default class extends Endpoint { // eslint- notifications = notifications.filter(notification => !excludeTypes.includes(notification.type)); } - //#region Check muting + //#region Check muting & suspended const [ userIdsWhoMeMuting, @@ -126,10 +126,12 @@ export default class extends Endpoint { // eslint- if (notifier === null) return null; if (notifier.host && userMutedInstances.has(notifier.host)) return null; + if (notifier.isSuspended) return null; + return notification; }))).filter((notification): notification is MiNotification => notification !== null); - //#endregion Check muting + //#endregion Check muting & suspended if (notifications.length === 0) { return [];