aboutsummaryrefslogtreecommitdiff
path: root/mastodon/status.go
diff options
context:
space:
mode:
Diffstat (limited to 'mastodon/status.go')
-rw-r--r--mastodon/status.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/mastodon/status.go b/mastodon/status.go
index 7a29b99..c8555d6 100644
--- a/mastodon/status.go
+++ b/mastodon/status.go
@@ -47,6 +47,7 @@ type Status struct {
Application Application `json:"application"`
Language string `json:"language"`
Pinned interface{} `json:"pinned"`
+ Bookmarked bool `json:"bookmarked"`
Poll *Poll `json:"poll"`
// Custom fields
@@ -366,3 +367,25 @@ func (c *Client) UnmuteConversation(ctx context.Context, id string) (*Status, er
}
return &status, nil
}
+
+// Bookmark bookmarks status specified by id.
+func (c *Client) Bookmark(ctx context.Context, id string) (*Status, error) {
+ var status Status
+
+ err := c.doAPI(ctx, http.MethodPost, fmt.Sprintf("/api/v1/statuses/%s/bookmark", id), nil, &status, nil)
+ if err != nil {
+ return nil, err
+ }
+ return &status, nil
+}
+
+// Unbookmark bookmarks status specified by id.
+func (c *Client) Unbookmark(ctx context.Context, id string) (*Status, error) {
+ var status Status
+
+ err := c.doAPI(ctx, http.MethodPost, fmt.Sprintf("/api/v1/statuses/%s/unbookmark", id), nil, &status, nil)
+ if err != nil {
+ return nil, err
+ }
+ return &status, nil
+}