[feature] Client API endpoints + v. basic web view for pinned posts (#1547)

* implement status pin client api + web handler

* make test names + comments more descriptive

* don't use separate table for status pins

* remove unused add + remove checking

* tidy up + add some more tests
This commit is contained in:
tobi
2023-02-25 13:16:30 +01:00
committed by GitHub
parent ecdc8379fa
commit c27b4d7ed0
29 changed files with 1015 additions and 62 deletions

View File

@ -5096,6 +5096,45 @@ paths:
summary: View accounts that have faved/starred/liked the target status.
tags:
- statuses
/api/v1/statuses/{id}/pin:
post:
description: |-
You can only pin original posts (not reblogs) that you authored yourself.
Supported privacy levels for pinned posts are public, unlisted, and private/followers-only,
but only public posts will appear on the web version of your profile.
operationId: statusPin
parameters:
- description: Target status ID.
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: The status.
schema:
$ref: '#/definitions/status'
"400":
description: bad request
"401":
description: unauthorized
"403":
description: forbidden
"404":
description: not found
"406":
description: not acceptable
"500":
description: internal server error
security:
- OAuth2 Bearer:
- write:accounts
summary: Pin a status to the top of your profile, and add it to your Featured ActivityPub collection.
tags:
- statuses
/api/v1/statuses/{id}/reblog:
post:
description: |-
@ -5233,6 +5272,40 @@ paths:
summary: Unstar/unlike/unfavourite the given status.
tags:
- statuses
/api/v1/statuses/{id}/unpin:
post:
operationId: statusUnpin
parameters:
- description: Target status ID.
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: The status.
schema:
$ref: '#/definitions/status'
"400":
description: bad request
"401":
description: unauthorized
"403":
description: forbidden
"404":
description: not found
"406":
description: not acceptable
"500":
description: internal server error
security:
- OAuth2 Bearer:
- write:accounts
summary: Unpin one of your pinned statuses.
tags:
- statuses
/api/v1/statuses/{id}/unreblog:
post:
operationId: statusUnreblog