summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/NotificationService.ts
diff options
context:
space:
mode:
authorzyoshoka <107108195+zyoshoka@users.noreply.github.com>2024-02-28 09:49:34 +0900
committerGitHub <noreply@github.com>2024-02-28 09:49:34 +0900
commit0d47877db1e1012aaba78a2926b165cf9e039d3d (patch)
treee545cd513ee43ece2a7c6431f741982ef1ca169c /packages/backend/src/core/NotificationService.ts
parentEnhance: コンディショナルロールの条件に「マニュアルロ... (diff)
downloadsharkey-0d47877db1e1012aaba78a2926b165cf9e039d3d.tar.gz
sharkey-0d47877db1e1012aaba78a2926b165cf9e039d3d.tar.bz2
sharkey-0d47877db1e1012aaba78a2926b165cf9e039d3d.zip
enhance(backend): フォロー・フォロワー関連の通知の受信設定の強化 (#13468)
* enhance(backend): 通知の受信設定に「フォロー中またはフォロワー」を追加 * fix(backend): 通知の受信設定で「相互フォロー」が正しく動作しない問題を修正 * Update CHANGELOG.md
Diffstat (limited to 'packages/backend/src/core/NotificationService.ts')
-rw-r--r--packages/backend/src/core/NotificationService.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/packages/backend/src/core/NotificationService.ts b/packages/backend/src/core/NotificationService.ts
index ee16193579..7224341991 100644
--- a/packages/backend/src/core/NotificationService.ts
+++ b/packages/backend/src/core/NotificationService.ts
@@ -126,6 +126,14 @@ export class NotificationService implements OnApplicationShutdown {
this.cacheService.userFollowingsCache.fetch(notifieeId).then(followings => Object.hasOwn(followings, notifierId)),
this.cacheService.userFollowingsCache.fetch(notifierId).then(followings => Object.hasOwn(followings, notifieeId)),
]);
+ if (!(isFollowing && isFollower)) {
+ return null;
+ }
+ } else if (recieveConfig?.type === 'followingOrFollower') {
+ const [isFollowing, isFollower] = await Promise.all([
+ this.cacheService.userFollowingsCache.fetch(notifieeId).then(followings => Object.hasOwn(followings, notifierId)),
+ this.cacheService.userFollowingsCache.fetch(notifierId).then(followings => Object.hasOwn(followings, notifieeId)),
+ ]);
if (!isFollowing && !isFollower) {
return null;
}