some updates to statuses and accounts

This commit is contained in:
tsmethurst 2021-05-15 17:21:41 +02:00
commit 0b8b0948f6
11 changed files with 251 additions and 132 deletions

View file

@ -86,23 +86,23 @@ type Status struct {
// It should be used at the path https://mastodon.example/api/v1/statuses
type StatusCreateRequest struct {
// Text content of the status. If media_ids is provided, this becomes optional. Attaching a poll is optional while status is provided.
Status string `form:"status"`
Status string `form:"status" json:"status" xml:"status"`
// Array of Attachment ids to be attached as media. If provided, status becomes optional, and poll cannot be used.
MediaIDs []string `form:"media_ids" json:"media_ids" xml:"media_ids"`
// Poll to include with this status.
Poll *PollRequest `form:"poll"`
Poll *PollRequest `form:"poll" json:"poll" xml:"poll"`
// ID of the status being replied to, if status is a reply
InReplyToID string `form:"in_reply_to_id"`
InReplyToID string `form:"in_reply_to_id" json:"in_reply_to_id" xml:"in_reply_to_id"`
// Mark status and attached media as sensitive?
Sensitive bool `form:"sensitive"`
Sensitive bool `form:"sensitive" json:"sensitive" xml:"sensitive"`
// Text to be shown as a warning or subject before the actual content. Statuses are generally collapsed behind this field.
SpoilerText string `form:"spoiler_text"`
SpoilerText string `form:"spoiler_text" json:"spoiler_text" xml:"spoiler_text"`
// Visibility of the posted status. Enumerable oneOf public, unlisted, private, direct.
Visibility Visibility `form:"visibility"`
Visibility Visibility `form:"visibility" json:"visibility" xml:"visibility"`
// ISO 8601 Datetime at which to schedule a status. Providing this paramter will cause ScheduledStatus to be returned instead of Status. Must be at least 5 minutes in the future.
ScheduledAt string `form:"scheduled_at"`
ScheduledAt string `form:"scheduled_at" json:"scheduled_at" xml:"scheduled_at"`
// ISO 639 language code for this status.
Language string `form:"language"`
Language string `form:"language" json:"language" xml:"language"`
}
// Visibility denotes the visibility of this status to other users
@ -130,13 +130,13 @@ type AdvancedStatusCreateForm struct {
// to the standard mastodon-compatible ones.
type AdvancedVisibilityFlagsForm struct {
// The gotosocial visibility model
VisibilityAdvanced *string `form:"visibility_advanced"`
VisibilityAdvanced *string `form:"visibility_advanced" json:"visibility_advanced" xml:"visibility_advanced"`
// This status will be federated beyond the local timeline(s)
Federated *bool `form:"federated"`
Federated *bool `form:"federated" json:"federated" xml:"federated"`
// This status can be boosted/reblogged
Boostable *bool `form:"boostable"`
Boostable *bool `form:"boostable" json:"boostable" xml:"boostable"`
// This status can be replied to
Replyable *bool `form:"replyable"`
Replyable *bool `form:"replyable" json:"replyable" xml:"replyable"`
// This status can be liked/faved
Likeable *bool `form:"likeable"`
Likeable *bool `form:"likeable" json:"likeable" xml:"likeable"`
}