Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Only show replies in Following if following all involved actors (#4869)

* Only show replies in Following for followed root and grandparent

* Remove now-unnecessary check

* Simplify condition

authored by

dan and committed by
GitHub
293ac6fa 7f292abf

+17 -27
+17 -27
src/lib/api/feed-manip.ts
··· 82 82 return AppBskyFeedDefs.isReasonRepost(reason) 83 83 } 84 84 85 - get includesThreadRoot() { 86 - return !this.items[0].reply 87 - } 88 - 89 85 get likeCount() { 90 86 return this._feedPost.post.likeCount ?? 0 91 87 } ··· 119 115 120 116 isFollowingAllAuthors(userDid: string) { 121 117 const feedPost = this._feedPost 122 - if (feedPost.post.author.did === userDid) { 123 - return true 124 - } 125 - if (AppBskyFeedDefs.isPostView(feedPost.reply?.parent)) { 126 - const parent = feedPost.reply?.parent 127 - if (parent?.author.did === userDid) { 128 - return true 118 + const authors = [feedPost.post.author] 119 + if (feedPost.reply) { 120 + if (AppBskyFeedDefs.isPostView(feedPost.reply.parent)) { 121 + authors.push(feedPost.reply.parent.author) 122 + } 123 + if (feedPost.reply.grandparentAuthor) { 124 + authors.push(feedPost.reply.grandparentAuthor) 125 + } 126 + if (AppBskyFeedDefs.isPostView(feedPost.reply.root)) { 127 + authors.push(feedPost.reply.root.author) 129 128 } 130 - return ( 131 - parent?.author.viewer?.following && 132 - feedPost.post.author.viewer?.following 133 - ) 134 129 } 135 - return false 130 + return authors.every(a => a.did === userDid || a.viewer?.following) 136 131 } 137 132 } 138 133 ··· 304 299 tuner: FeedTuner, 305 300 slices: FeedViewPostsSlice[], 306 301 ): FeedViewPostsSlice[] => { 307 - // remove any replies without at least minLikes likes 308 302 for (let i = slices.length - 1; i >= 0; i--) { 309 303 const slice = slices[i] 310 - if (slice.isReply) { 311 - if (slice.isThread && slice.includesThreadRoot) { 312 - continue 313 - } 314 - if (slice.isRepost) { 315 - continue 316 - } 317 - if (!slice.isFollowingAllAuthors(userDid)) { 318 - slices.splice(i, 1) 319 - } 304 + if ( 305 + slice.isReply && 306 + !slice.isRepost && 307 + !slice.isFollowingAllAuthors(userDid) 308 + ) { 309 + slices.splice(i, 1) 320 310 } 321 311 } 322 312 return slices