diff --git a/packages/bsky/src/api/app/bsky/feed/getFeed.ts b/packages/bsky/src/api/app/bsky/feed/getFeed.ts index b4c85ad7f2c..815a1cb671f 100644 --- a/packages/bsky/src/api/app/bsky/feed/getFeed.ts +++ b/packages/bsky/src/api/app/bsky/feed/getFeed.ts @@ -111,7 +111,8 @@ const noBlocksOrMutes = (inputs: RulesFnInput) => { !bam.authorBlocked && !bam.authorMuted && !bam.originatorBlocked && - !bam.originatorMuted + !bam.originatorMuted && + !bam.parentAuthorBlocked ) }) return skeleton diff --git a/packages/bsky/src/api/app/bsky/feed/getListFeed.ts b/packages/bsky/src/api/app/bsky/feed/getListFeed.ts index 5250865cfc2..07940f04374 100644 --- a/packages/bsky/src/api/app/bsky/feed/getListFeed.ts +++ b/packages/bsky/src/api/app/bsky/feed/getListFeed.ts @@ -86,7 +86,8 @@ const noBlocksOrMutes = (inputs: { !bam.authorBlocked && !bam.authorMuted && !bam.originatorBlocked && - !bam.originatorMuted + !bam.originatorMuted && + !bam.parentAuthorBlocked ) }) return skeleton diff --git a/packages/bsky/src/api/app/bsky/feed/getTimeline.ts b/packages/bsky/src/api/app/bsky/feed/getTimeline.ts index 8e5dc488c33..5b67c39835c 100644 --- a/packages/bsky/src/api/app/bsky/feed/getTimeline.ts +++ b/packages/bsky/src/api/app/bsky/feed/getTimeline.ts @@ -89,7 +89,8 @@ const noBlocksOrMutes = (inputs: { !bam.authorBlocked && !bam.authorMuted && !bam.originatorBlocked && - !bam.originatorMuted + !bam.originatorMuted && + !bam.parentAuthorBlocked ) }) return skeleton diff --git a/packages/bsky/src/views/index.ts b/packages/bsky/src/views/index.ts index c5c573ca97c..41e720a2e05 100644 --- a/packages/bsky/src/views/index.ts +++ b/packages/bsky/src/views/index.ts @@ -334,16 +334,23 @@ export class Views { originatorBlocked: boolean authorMuted: boolean authorBlocked: boolean + parentAuthorBlocked: boolean } { const authorDid = creatorFromUri(item.post.uri) const originatorDid = item.repost ? creatorFromUri(item.repost.uri) : authorDid + const post = state.posts?.get(item.post.uri) + const parentUri = post?.record.reply?.parent.uri + const parentAuthorDid = parentUri && creatorFromUri(parentUri) return { originatorMuted: this.viewerMuteExists(originatorDid, state), originatorBlocked: this.viewerBlockExists(originatorDid, state), authorMuted: this.viewerMuteExists(authorDid, state), authorBlocked: this.viewerBlockExists(authorDid, state), + parentAuthorBlocked: parentAuthorDid + ? this.viewerBlockExists(parentAuthorDid, state) + : false, } } diff --git a/packages/bsky/tests/views/blocks.test.ts b/packages/bsky/tests/views/blocks.test.ts index 84d82fce51b..2e7759d8157 100644 --- a/packages/bsky/tests/views/blocks.test.ts +++ b/packages/bsky/tests/views/blocks.test.ts @@ -160,8 +160,14 @@ describe('pds views with blocking', () => { { limit: 100 }, { headers: await network.serviceHeaders(carol) }, ) + + // dan's posts don't appear, nor alice's reply to dan. expect( - resCarol.data.feed.some((post) => post.post.author.did === dan), + resCarol.data.feed.some( + (post) => + post.post.author.did === dan || + post.reply?.parent.author?.['did'] === dan, + ), ).toBeFalsy() const resDan = await agent.api.app.bsky.feed.getTimeline( @@ -169,7 +175,11 @@ describe('pds views with blocking', () => { { headers: await network.serviceHeaders(dan) }, ) expect( - resDan.data.feed.some((post) => post.post.author.did === carol), + resDan.data.feed.some( + (post) => + post.post.author.did === carol || + post.reply?.parent.author?.['did'] === carol, + ), ).toBeFalsy() })