aboutsummaryrefslogtreecommitdiff
path: root/mastodon
diff options
context:
space:
mode:
authorr <r@freesoftwareextremist.com>2020-02-02 07:24:06 +0000
committerr <r@freesoftwareextremist.com>2020-02-02 07:24:06 +0000
commit4d9e0af373b3a92d04498070c6fc8f6c197fc9c0 (patch)
treecdd8f8f3b2decbcf85bad4235bb4b914f39bbaad /mastodon
parentc702a2b501769697576d601875d1db4553eeff12 (diff)
downloadbloat-4d9e0af373b3a92d04498070c6fc8f6c197fc9c0.tar.gz
bloat-4d9e0af373b3a92d04498070c6fc8f6c197fc9c0.zip
Add conversation muting
Diffstat (limited to 'mastodon')
-rw-r--r--mastodon/status.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/mastodon/status.go b/mastodon/status.go
index 22f042c..63de3cf 100644
--- a/mastodon/status.go
+++ b/mastodon/status.go
@@ -343,3 +343,25 @@ func (c *Client) GetTimelineDirect(ctx context.Context, pg *Pagination) ([]*Stat
}
return statuses, nil
}
+
+// MuteConversation mutes status specified by id.
+func (c *Client) MuteConversation(ctx context.Context, id string) (*Status, error) {
+ var status Status
+
+ err := c.doAPI(ctx, http.MethodPost, fmt.Sprintf("/api/v1/statuses/%s/mute", id), nil, &status, nil)
+ if err != nil {
+ return nil, err
+ }
+ return &status, nil
+}
+
+// UnmuteConversation unmutes status specified by id.
+func (c *Client) UnmuteConversation(ctx context.Context, id string) (*Status, error) {
+ var status Status
+
+ err := c.doAPI(ctx, http.MethodPost, fmt.Sprintf("/api/v1/statuses/%s/unmute", id), nil, &status, nil)
+ if err != nil {
+ return nil, err
+ }
+ return &status, nil
+}