add expires status and language code

This commit is contained in:
localhost_frssoft 2023-11-09 23:14:42 +03:00
parent 44f8a72a76
commit 4cd8fb2ddb
5 changed files with 23 additions and 2 deletions

View file

@ -210,6 +210,8 @@ type Toot struct {
SpoilerText string `json:"spoiler_text"`
Visibility string `json:"visibility"`
ContentType string `json:"content_type"`
Language string `json:"language"`
ExpiresIn int `json:"expires_in"`
}
// Mention hold information for mention.

View file

@ -358,6 +358,13 @@ func (c *Client) PostStatus(ctx context.Context, toot *Toot) (*Status, error) {
if toot.ContentType != "" {
params.Set("content_type", toot.ContentType)
}
if toot.Language != "" {
params.Set("language", toot.Language)
}
if toot.ExpiresIn >= 3600 {
params.Set("expires_in", fmt.Sprint(toot.ExpiresIn))
}
var status Status
if toot.Edit != "" {
err := c.doAPI(ctx, http.MethodPut, fmt.Sprintf("/api/v1/statuses/%s", toot.Edit), params, &status, nil)