mirror of
https://gitea.phreedom.club/localhost_frssoft/bloat.git
synced 2025-05-10 13:58:46 +00:00
add expires status and language code
This commit is contained in:
parent
44f8a72a76
commit
4cd8fb2ddb
5 changed files with 23 additions and 2 deletions
|
@ -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.
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue