enhance(backend): フォロー・フォロワー関連の通知の受信設定の強化 (#13468)
* enhance(backend): 通知の受信設定に「フォロー中またはフォロワー」を追加 * fix(backend): 通知の受信設定で「相互フォロー」が正しく動作しない問題を修正 * Update CHANGELOG.md
This commit is contained in:
@@ -122,6 +122,14 @@ export class NotificationService implements OnApplicationShutdown {
|
||||
return null;
|
||||
}
|
||||
} else if (recieveConfig?.type === 'mutualFollow') {
|
||||
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;
|
||||
}
|
||||
} 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)),
|
||||
|
@@ -249,6 +249,8 @@ export class MiUserProfile {
|
||||
type: 'follower';
|
||||
} | {
|
||||
type: 'mutualFollow';
|
||||
} | {
|
||||
type: 'followingOrFollower';
|
||||
} | {
|
||||
type: 'list';
|
||||
userListId: MiUserList['id'];
|
||||
|
@@ -13,7 +13,7 @@ export const notificationRecieveConfig = {
|
||||
type: {
|
||||
type: 'string',
|
||||
nullable: false,
|
||||
enum: ['all', 'following', 'follower', 'mutualFollow', 'never'],
|
||||
enum: ['all', 'following', 'follower', 'mutualFollow', 'followingOrFollower', 'never'],
|
||||
},
|
||||
},
|
||||
required: ['type'],
|
||||
|
Reference in New Issue
Block a user