Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

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

Show some known OP replies in Following (#5049)

* Show known OP replies in Following

* Fiter by >0 parent likes

authored by

dan and committed by
GitHub
bff6aede 3d992f6b

+21 -6
+21 -6
src/lib/api/feed-manip.ts
··· 366 366 ): FeedViewPostsSlice[] => { 367 367 for (let i = 0; i < slices.length; i++) { 368 368 const slice = slices[i] 369 - if ( 370 - slice.isReply && 371 - !slice.isRepost && 372 - !shouldDisplayReplyInFollowing(slice.getAuthors(), userDid) 373 - ) { 369 + if (slice.isReply && !shouldDisplayReplyInFollowing(slice, userDid)) { 374 370 slices.splice(i, 1) 375 371 i-- 376 372 } ··· 434 430 } 435 431 436 432 function shouldDisplayReplyInFollowing( 437 - authors: AuthorContext, 433 + slice: FeedViewPostsSlice, 438 434 userDid: string, 439 435 ): boolean { 436 + if (slice.isRepost) { 437 + return true 438 + } 439 + const authors = slice.getAuthors() 440 440 const {author, parentAuthor, grandparentAuthor, rootAuthor} = authors 441 441 if (!isSelfOrFollowing(author, userDid)) { 442 442 // Only show replies from self or people you follow. ··· 449 449 ) { 450 450 // Always show self-threads. 451 451 return true 452 + } 453 + if ( 454 + parentAuthor && 455 + parentAuthor.did !== author.did && 456 + rootAuthor && 457 + rootAuthor.did === author.did && 458 + slice.items.length > 2 459 + ) { 460 + // If you follow A, show A -> someone[>0 likes] -> A chains too. 461 + // This is different from cases below because you only know one person. 462 + const parentPost = slice.items[1].post 463 + const parentLikeCount = parentPost.likeCount ?? 0 464 + if (parentLikeCount > 0) { 465 + return true 466 + } 452 467 } 453 468 // From this point on we need at least one more reason to show it. 454 469 if (