Add Twitter API for the pinned statuses
``` # Only return statuses that have been pinned GET /api/statuses/user_timeline.json?pinned=true # Pin POST /api/statuses/pin/:id # Unpin POST /api/statuses/unpin/:id ```
This commit is contained in:
parent
1b06e6fdf3
commit
44a1e69484
8 changed files with 119 additions and 3 deletions
|
|
@ -153,6 +153,7 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenter do
|
|||
announcement_count = object["announcement_count"] || 0
|
||||
favorited = opts[:for] && opts[:for].ap_id in (object["likes"] || [])
|
||||
repeated = opts[:for] && opts[:for].ap_id in (object["announcements"] || [])
|
||||
pinned = activity.id in user.info.pinned_activities
|
||||
|
||||
mentions = opts[:mentioned] || []
|
||||
|
||||
|
|
@ -202,6 +203,7 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenter do
|
|||
"repeat_num" => announcement_count,
|
||||
"favorited" => to_boolean(favorited),
|
||||
"repeated" => to_boolean(repeated),
|
||||
"pinned" => pinned,
|
||||
"external_url" => object["external_url"] || object["id"],
|
||||
"tags" => tags,
|
||||
"activity_type" => "post",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue