summaryrefslogtreecommitdiff
path: root/src/models/user.ts
diff options
context:
space:
mode:
authorAkihiko Odaki <nekomanma@pixiv.co.jp>2018-04-02 21:57:36 +0900
committerAkihiko Odaki <nekomanma@pixiv.co.jp>2018-04-02 22:00:40 +0900
commit319e905bf9e5398cb62eaeee7da80ff6e942c094 (patch)
tree5d0edf01e29d7904bf4b82d57ff60754741ce100 /src/models/user.ts
parentImplement Follow activity (diff)
downloadmisskey-319e905bf9e5398cb62eaeee7da80ff6e942c094.tar.gz
misskey-319e905bf9e5398cb62eaeee7da80ff6e942c094.tar.bz2
misskey-319e905bf9e5398cb62eaeee7da80ff6e942c094.zip
Introduce followed log and following log
Diffstat (limited to 'src/models/user.ts')
-rw-r--r--src/models/user.ts12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/models/user.ts b/src/models/user.ts
index d3c94cab3e..f817c33aa2 100644
--- a/src/models/user.ts
+++ b/src/models/user.ts
@@ -234,8 +234,7 @@ export const pack = (
_user.isFollowing = (async () => {
const follow = await Following.findOne({
followerId: meId,
- followeeId: _user.id,
- deletedAt: { $exists: false }
+ followeeId: _user.id
});
return follow !== null;
})();
@@ -244,8 +243,7 @@ export const pack = (
_user.isFollowed = (async () => {
const follow2 = await Following.findOne({
followerId: _user.id,
- followeeId: meId,
- deletedAt: { $exists: false }
+ followeeId: meId
});
return follow2 !== null;
})();
@@ -275,15 +273,13 @@ export const pack = (
// Get following you know count
_user.followingYouKnowCount = Following.count({
followeeId: { $in: myFollowingIds },
- followerId: _user.id,
- deletedAt: { $exists: false }
+ followerId: _user.id
});
// Get followers you know count
_user.followersYouKnowCount = Following.count({
followeeId: _user.id,
- followerId: { $in: myFollowingIds },
- deletedAt: { $exists: false }
+ followerId: { $in: myFollowingIds }
});
}
}