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:
parent
25e24b053a
commit
21e3b04391
7 changed files with 147 additions and 38 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue