mirror of
https://gitea.phreedom.club/localhost_frssoft/bloat.git
synced 2025-05-10 05:48:46 +00:00
Add support for expiring mutes
This commit is contained in:
parent
9816045c21
commit
5147897c6c
7 changed files with 64 additions and 25 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue