diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2018-07-11 14:06:07 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-07-11 14:06:07 +0900 |
| commit | 58fdeb50f34ff9f66cf201583924911c2ac65205 (patch) | |
| tree | d462b3a20d79c6ed7e15e7961aacfe54cb4265a9 /src/server/api/common | |
| parent | oops (diff) | |
| parent | wip (diff) | |
| download | misskey-58fdeb50f34ff9f66cf201583924911c2ac65205.tar.gz misskey-58fdeb50f34ff9f66cf201583924911c2ac65205.tar.bz2 misskey-58fdeb50f34ff9f66cf201583924911c2ac65205.zip | |
Merge pull request #1879 from syuilo/hybrid-tl
Hybrid tl
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 => ({ |