aboutsummaryrefslogtreecommitdiff
path: root/mastodon
diff options
context:
space:
mode:
authorr <r@freesoftwareextremist.com>2021-10-29 14:20:15 +0000
committerr <r@freesoftwareextremist.com>2021-10-29 14:20:15 +0000
commit4d68062f2d0525a9d2a40e50d60ea9b25daae9ad (patch)
treef6a8fd244a81dc1f9632aa04b5285118e2aa7191 /mastodon
parent7d389d22581cc785005a42d655eb7f9c32aac3ec (diff)
downloadbloat-4d68062f2d0525a9d2a40e50d60ea9b25daae9ad.tar.gz
bloat-4d68062f2d0525a9d2a40e50d60ea9b25daae9ad.zip
Add "mute (keep notifications)" button
Diffstat (limited to 'mastodon')
-rw-r--r--mastodon/accounts.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/mastodon/accounts.go b/mastodon/accounts.go
index 694e672..df0a3b7 100644
--- a/mastodon/accounts.go
+++ b/mastodon/accounts.go
@@ -243,9 +243,13 @@ func (c *Client) AccountUnblock(ctx context.Context, id string) (*Relationship,
}
// AccountMute mute the account.
-func (c *Client) AccountMute(ctx context.Context, id string) (*Relationship, error) {
+func (c *Client) AccountMute(ctx context.Context, id string, notifications *bool) (*Relationship, error) {
+ params := url.Values{}
+ if notifications != nil {
+ params.Set("notifications", strconv.FormatBool(*notifications))
+ }
var relationship Relationship
- err := c.doAPI(ctx, http.MethodPost, fmt.Sprintf("/api/v1/accounts/%s/mute", url.PathEscape(string(id))), nil, &relationship, nil)
+ err := c.doAPI(ctx, http.MethodPost, fmt.Sprintf("/api/v1/accounts/%s/mute", url.PathEscape(string(id))), params, &relationship, nil)
if err != nil {
return nil, err
}