summaryrefslogtreecommitdiff
path: root/src/models
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-06-01 00:42:37 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-06-01 00:42:37 +0900
commit35115607bc7eb1ff974c7f7c4d9f14bc8377ee6e (patch)
treecd5e818d8a0bb619db02c42f3ca62b9ba77fcc5b /src/models
parentwip (diff)
downloadmisskey-35115607bc7eb1ff974c7f7c4d9f14bc8377ee6e.tar.gz
misskey-35115607bc7eb1ff974c7f7c4d9f14bc8377ee6e.tar.bz2
misskey-35115607bc7eb1ff974c7f7c4d9f14bc8377ee6e.zip
wip
Diffstat (limited to 'src/models')
-rw-r--r--src/models/user.ts13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/models/user.ts b/src/models/user.ts
index aa051517f1..4186241a59 100644
--- a/src/models/user.ts
+++ b/src/models/user.ts
@@ -416,7 +416,7 @@ export const pack = (
}
if (meId && !meId.equals(_user.id)) {
- const [following1, following2, mute] = await Promise.all([
+ const [following1, following2, followReq1, followReq2, mute] = await Promise.all([
Following.findOne({
followerId: meId,
followeeId: _user.id
@@ -425,6 +425,14 @@ export const pack = (
followerId: _user.id,
followeeId: meId
}),
+ _user.isLocked ? FollowRequest.findOne({
+ followerId: meId,
+ followeeId: _user.id
+ }) : Promise.resolve(null),
+ FollowRequest.findOne({
+ followerId: _user.id,
+ followeeId: meId
+ }),
Mute.findOne({
muterId: meId,
muteeId: _user.id
@@ -435,6 +443,9 @@ export const pack = (
_user.isFollowing = following1 !== null;
_user.isStalking = following1 && following1.stalk;
+ _user.hasPendingFollowRequestFromYou = followReq1 !== null;
+ _user.hasPendingFollowRequestToYou = followReq2 !== null;
+
// Whether the user is followed
_user.isFollowed = following2 !== null;