diff options
Diffstat (limited to 'src/lib/api/feed/author.ts')
-rw-r--r-- | src/lib/api/feed/author.ts | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/lib/api/feed/author.ts b/src/lib/api/feed/author.ts index 56eff1881..50e6a447e 100644 --- a/src/lib/api/feed/author.ts +++ b/src/lib/api/feed/author.ts @@ -8,7 +8,7 @@ import {FeedAPI, FeedAPIResponse} from './types' export class AuthorFeedAPI implements FeedAPI { agent: BskyAgent - params: GetAuthorFeed.QueryParams + _params: GetAuthorFeed.QueryParams constructor({ agent, @@ -18,7 +18,13 @@ export class AuthorFeedAPI implements FeedAPI { feedParams: GetAuthorFeed.QueryParams }) { this.agent = agent - this.params = feedParams + this._params = feedParams + } + + get params() { + const params = {...this._params} + params.includePins = params.filter !== 'posts_with_media' + return params } async peekLatest(): Promise<AppBskyFeedDefs.FeedViewPost> { @@ -57,8 +63,9 @@ export class AuthorFeedAPI implements FeedAPI { return feed.filter(post => { const isReply = post.reply const isRepost = AppBskyFeedDefs.isReasonRepost(post.reason) + const isPin = AppBskyFeedDefs.isReasonPin(post.reason) if (!isReply) return true - if (isRepost) return true + if (isRepost || isPin) return true return isReply && isAuthorReplyChain(this.params.actor, post, feed) }) } |