mirror of
https://gitea.phreedom.club/localhost_frssoft/bloat.git
synced 2025-05-10 13:58:46 +00:00
Added pin\unpin statuses; Status ID in code tag
This commit is contained in:
parent
9a6e1324d5
commit
4df1f096be
4 changed files with 48 additions and 2 deletions
|
@ -332,15 +332,25 @@ func (c *Client) PostStatus(ctx context.Context, toot *Toot) (*Status, error) {
|
|||
if toot.ContentType != "" {
|
||||
params.Set("content_type", toot.ContentType)
|
||||
}
|
||||
|
||||
var status Status
|
||||
err := c.doAPI(ctx, http.MethodPost, "/api/v1/statuses", params, &status, nil)
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &status, nil
|
||||
}
|
||||
|
||||
// Pin pin your status.
|
||||
func (c *Client) Pin(ctx context.Context, id string) error {
|
||||
return c.doAPI(ctx, http.MethodPost, fmt.Sprintf("/api/v1/statuses/%s/pin", id), nil, nil, nil)
|
||||
}
|
||||
|
||||
// UnPin unpin your status.
|
||||
func (c *Client) UnPin(ctx context.Context, id string) error {
|
||||
return c.doAPI(ctx, http.MethodPost, fmt.Sprintf("/api/v1/statuses/%s/unpin", id), nil, nil, nil)
|
||||
}
|
||||
|
||||
// DeleteStatus delete the toot.
|
||||
func (c *Client) DeleteStatus(ctx context.Context, id string) error {
|
||||
return c.doAPI(ctx, http.MethodDelete, fmt.Sprintf("/api/v1/statuses/%s", id), nil, nil, nil)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue