mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-29 05:17:39 -07:00
[mastodon-client] Fix own user following/followers when ffVisibility is restricted
This commit is contained in:
parent
97067648e8
commit
dd0875e517
1 changed files with 10 additions and 8 deletions
|
@ -83,17 +83,19 @@ export class UserHelpers {
|
||||||
|
|
||||||
const profile = await UserProfiles.findOneByOrFail({ userId: user.id });
|
const profile = await UserProfiles.findOneByOrFail({ userId: user.id });
|
||||||
if (profile.ffVisibility === "private") {
|
if (profile.ffVisibility === "private") {
|
||||||
if (!localUser || user.id != localUser.id) return { data: [] };
|
if (!localUser || user.id !== localUser.id) return { data: [] };
|
||||||
}
|
}
|
||||||
else if (profile.ffVisibility === "followers") {
|
else if (profile.ffVisibility === "followers") {
|
||||||
if (!localUser) return { data: [] };
|
if (!localUser) return { data: [] };
|
||||||
const isFollowed = await Followings.exist({
|
if (user.id !== localUser.id) {
|
||||||
where: {
|
const isFollowed = await Followings.exist({
|
||||||
followeeId: user.id,
|
where: {
|
||||||
followerId: localUser.id,
|
followeeId: user.id,
|
||||||
},
|
followerId: localUser.id,
|
||||||
});
|
},
|
||||||
if (!isFollowed) return { data: [] };
|
});
|
||||||
|
if (!isFollowed) return { data: [] };
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const query = PaginationHelpers.makePaginationQuery(
|
const query = PaginationHelpers.makePaginationQuery(
|
||||||
|
|
Loading…
Reference in a new issue