diff options
author | dan <dan.abramov@gmail.com> | 2024-09-12 18:45:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-12 18:45:19 +0100 |
commit | 897d8ba744c576ee954dfc79ec4deac176b47a6a (patch) | |
tree | 52f7bdf0cd39a2591dac5499e5b0d3778e2de846 /src/lib/api | |
parent | 86abeb80b9e863b0a1d5eaebe725a676cee4ae09 (diff) | |
download | voidsky-897d8ba744c576ee954dfc79ec4deac176b47a6a.tar.zst |
This reverts commit bff6aedecf007a4225bf30e1800933a9005cb0b2.
Diffstat (limited to 'src/lib/api')
-rw-r--r-- | src/lib/api/feed-manip.ts | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/src/lib/api/feed-manip.ts b/src/lib/api/feed-manip.ts index eaa760b4b..0eca8b165 100644 --- a/src/lib/api/feed-manip.ts +++ b/src/lib/api/feed-manip.ts @@ -379,7 +379,11 @@ export class FeedTuner { ): FeedViewPostsSlice[] => { for (let i = 0; i < slices.length; i++) { const slice = slices[i] - if (slice.isReply && !shouldDisplayReplyInFollowing(slice, userDid)) { + if ( + slice.isReply && + !slice.isRepost && + !shouldDisplayReplyInFollowing(slice.getAuthors(), userDid) + ) { slices.splice(i, 1) i-- } @@ -443,13 +447,9 @@ function areSameAuthor(authors: AuthorContext): boolean { } function shouldDisplayReplyInFollowing( - slice: FeedViewPostsSlice, + authors: AuthorContext, userDid: string, ): boolean { - if (slice.isRepost) { - return true - } - const authors = slice.getAuthors() const {author, parentAuthor, grandparentAuthor, rootAuthor} = authors if (!isSelfOrFollowing(author, userDid)) { // Only show replies from self or people you follow. @@ -463,21 +463,6 @@ function shouldDisplayReplyInFollowing( // Always show self-threads. return true } - if ( - parentAuthor && - parentAuthor.did !== author.did && - rootAuthor && - rootAuthor.did === author.did && - slice.items.length > 2 - ) { - // If you follow A, show A -> someone[>0 likes] -> A chains too. - // This is different from cases below because you only know one person. - const parentPost = slice.items[1].post - const parentLikeCount = parentPost.likeCount ?? 0 - if (parentLikeCount > 0) { - return true - } - } // From this point on we need at least one more reason to show it. if ( parentAuthor && |