kopia lustrzana https://github.com/jointakahe/takahe
Add pinned=true support to listing account statuses
rodzic
2220448b53
commit
d05b59ccb5
|
@ -1162,4 +1162,6 @@ class Post(StatorModel):
|
|||
value["reblogged"] = self.pk in interactions.get("boost", [])
|
||||
if bookmarks:
|
||||
value["bookmarked"] = self.pk in bookmarks
|
||||
if identity and identity.pinned:
|
||||
value["pinned"] = self.object_uri in identity.pinned
|
||||
return value
|
||||
|
|
|
@ -170,7 +170,9 @@ class Status(Schema):
|
|||
) -> "Status":
|
||||
return cls(
|
||||
**post.to_mastodon_json(
|
||||
interactions=interactions, bookmarks=bookmarks, identity=identity
|
||||
interactions=interactions,
|
||||
bookmarks=bookmarks,
|
||||
identity=identity,
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -186,7 +188,10 @@ class Status(Schema):
|
|||
bookmarks = users_models.Bookmark.for_identity(identity, posts)
|
||||
return [
|
||||
cls.from_post(
|
||||
post, interactions=interactions, bookmarks=bookmarks, identity=identity
|
||||
post,
|
||||
interactions=interactions,
|
||||
bookmarks=bookmarks,
|
||||
identity=identity,
|
||||
)
|
||||
for post in posts
|
||||
]
|
||||
|
|
|
@ -200,7 +200,7 @@ def account_statuses(
|
|||
.order_by("-created")
|
||||
)
|
||||
if pinned:
|
||||
return ApiResponse([])
|
||||
queryset = queryset.filter(object_uri__in=identity.pinned)
|
||||
if only_media:
|
||||
queryset = queryset.filter(attachments__pk__isnull=False)
|
||||
if tagged:
|
||||
|
|
Ładowanie…
Reference in New Issue