diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-07-11 14:03:21 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-07-11 14:03:21 +0900 |
| commit | 1af3c42001550f573488864593d9739ed83c3cfe (patch) | |
| tree | d462b3a20d79c6ed7e15e7961aacfe54cb4265a9 /src/server/api/common | |
| parent | Merge branch 'master' into hybrid-tl (diff) | |
| download | misskey-1af3c42001550f573488864593d9739ed83c3cfe.tar.gz misskey-1af3c42001550f573488864593d9739ed83c3cfe.tar.bz2 misskey-1af3c42001550f573488864593d9739ed83c3cfe.zip | |
wip
Diffstat (limited to 'src/server/api/common')
| -rw-r--r-- | src/server/api/common/get-friends.ts | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/server/api/common/get-friends.ts b/src/server/api/common/get-friends.ts index 50ba71ea96..e0b05f73df 100644 --- a/src/server/api/common/get-friends.ts +++ b/src/server/api/common/get-friends.ts @@ -23,12 +23,16 @@ export const getFriendIds = async (me: mongodb.ObjectID, includeMe = true) => { return myfollowingIds; }; -export const getFriends = async (me: mongodb.ObjectID, includeMe = true) => { +export const getFriends = async (me: mongodb.ObjectID, includeMe = true, remoteOnly = false) => { + const q: any = remoteOnly ? { + followerId: me, + '_followee.host': { $ne: null } + } : { + followerId: me + }; // Fetch relation to other users who the I follows const followings = await Following - .find({ - followerId: me - }); + .find(q); // ID list of other users who the I follows const myfollowings = followings.map(following => ({ |