-
Notifications
You must be signed in to change notification settings - Fork 554
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
only include media posts by post creator #1486
Conversation
) | ||
feedItemsQb = feedItemsQb | ||
// and only your own posts/reposts | ||
.where('post.creator', '=', did) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only query change in both PDS and App View
const isActorMedia = isImageEmbed(post.embed) | ||
const isFromActor = post.author.did === carol | ||
|
||
return (isRecordWithActorMedia || isActorMedia) && isFromActor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tightened up these tests to ensure that the author is the actor in question
expect(danFeed.feed.length).toEqual(0) | ||
}) | ||
|
||
it('filters by posts_no_replies', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And split a test out
let actorDid = '' | ||
if (actor.startsWith('did:')) { | ||
actorDid = actor | ||
} else { | ||
const actorRes = await ctx.db.db | ||
.selectFrom('did_handle') | ||
.select('did') | ||
.where('did_handle.handle', '=', actor) | ||
.executeTakeFirst() | ||
if (actorRes) { | ||
actorDid = actorRes?.did | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved this out of getFeedItemsQb
using the same approach as the App View
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great 👍
think you can use the existing getActorDid
method to simplify it a bit (I imagine we're going to start sprinkling that around a bit more)
Sweet! |
…167-media-reposts only include media posts by post creator
Fixes bluesky-social/social-app#1167