fix(backend): check visibility of following/followers of remote users / feat: moderators can see following/followers of all users (#14375)

Cherry-picked from 0d508db8a7a36218d38231af4e718aff0e94d9bc

Co-authored-by: Daiki Mizukami <tesaguriguma@gmail.com>
This commit is contained in:
Daiki Mizukami 2024-08-09 12:10:51 +09:00 committed by あわわわとーにゅ
parent 25e24b053a
commit 21e3b04391
No known key found for this signature in database
GPG key ID: 6AFBBF529601C1DB
7 changed files with 147 additions and 38 deletions

View file

@ -7,7 +7,7 @@ import * as Misskey from 'misskey-js';
import { $i } from '@/account.js';
export function isFollowingVisibleForMe(user: Misskey.entities.UserDetailed): boolean {
if ($i && $i.id === user.id) return true;
if ($i && ($i.id === user.id || $i.isAdmin || $i.isModerator)) return true;
if (user.followingVisibility === 'private') return false;
if (user.followingVisibility === 'followers' && !user.isFollowing) return false;
@ -15,7 +15,7 @@ export function isFollowingVisibleForMe(user: Misskey.entities.UserDetailed): bo
return true;
}
export function isFollowersVisibleForMe(user: Misskey.entities.UserDetailed): boolean {
if ($i && $i.id === user.id) return true;
if ($i && ($i.id === user.id || $i.isAdmin || $i.isModerator)) return true;
if (user.followersVisibility === 'private') return false;
if (user.followersVisibility === 'followers' && !user.isFollowing) return false;