From 5147897c6c8ba3428ea6998f77241182ee8caa24 Mon Sep 17 00:00:00 2001 From: r Date: Sat, 17 Dec 2022 08:26:51 +0000 Subject: Add support for expiring mutes --- mastodon/accounts.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'mastodon/accounts.go') 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 { -- cgit v1.2.3