aboutsummaryrefslogtreecommitdiff
path: root/mastodon
diff options
context:
space:
mode:
authorr <r@freesoftwareextremist.com>2022-12-17 08:26:51 +0000
committerr <r@freesoftwareextremist.com>2022-12-17 08:26:51 +0000
commit5147897c6c8ba3428ea6998f77241182ee8caa24 (patch)
treee0177960dfda43c901f5feb458186077f96e4abd /mastodon
parent9816045c21957bfda6760ca058eaae97901e3b63 (diff)
downloadbloat-5147897c6c8ba3428ea6998f77241182ee8caa24.tar.gz
bloat-5147897c6c8ba3428ea6998f77241182ee8caa24.zip
Add support for expiring mutes
Diffstat (limited to 'mastodon')
-rw-r--r--mastodon/accounts.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/mastodon/accounts.go b/mastodon/accounts.go
index 540adb2..f4e9002 100644
--- a/mastodon/accounts.go
+++ b/mastodon/accounts.go
@@ -246,11 +246,10 @@ func (c *Client) AccountUnblock(ctx context.Context, id string) (*Relationship,
}
// AccountMute mute the account.
-func (c *Client) AccountMute(ctx context.Context, id string, notifications *bool) (*Relationship, error) {
+func (c *Client) AccountMute(ctx context.Context, id string, notifications bool, duration int) (*Relationship, error) {
params := url.Values{}
- if notifications != nil {
- params.Set("notifications", strconv.FormatBool(*notifications))
- }
+ params.Set("notifications", strconv.FormatBool(notifications))
+ params.Set("duration", strconv.Itoa(duration))
var relationship Relationship
err := c.doAPI(ctx, http.MethodPost, fmt.Sprintf("/api/v1/accounts/%s/mute", url.PathEscape(string(id))), params, &relationship, nil)
if err != nil {