Add support for expiring mutes

This commit is contained in:
r 2022-12-17 08:26:51 +00:00
parent 9816045c21
commit 5147897c6c
7 changed files with 64 additions and 25 deletions

View file

@ -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 {