mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-23 16:36:19 -06:00
Add ContentType to internal models
This commit is contained in:
parent
ab7ec43988
commit
2791a9951f
2 changed files with 28 additions and 1 deletions
|
|
@ -74,6 +74,7 @@ type Status struct {
|
|||
PendingApproval *bool `bun:",nullzero,notnull,default:false"` // If true then status is a reply or boost wrapper that must be Approved by the reply-ee or boost-ee before being fully distributed.
|
||||
PreApproved bool `bun:"-"` // If true, then status is a reply to or boost wrapper of a status on our instance, has permission to do the interaction, and an Accept should be sent out for it immediately. Field not stored in the DB.
|
||||
ApprovedByURI string `bun:",nullzero"` // URI of an Accept Activity that approves the Announce or Create Activity that this status was/will be attached to.
|
||||
ContentType StatusContentType `bun:",nullzero"` // TODO
|
||||
}
|
||||
|
||||
// GetID implements timeline.Timelineable{}.
|
||||
|
|
@ -376,6 +377,32 @@ func (v Visibility) String() string {
|
|||
}
|
||||
}
|
||||
|
||||
// StatusContentType is the content type with which a status's text is
|
||||
// parsed. Can be either plain or markdown. Empty will default to plain.
|
||||
type StatusContentType enumType
|
||||
|
||||
const (
|
||||
// The "unset"
|
||||
StatusContentTypePlain StatusContentType = 1
|
||||
StatusContentTypeMarkdown StatusContentType = 2
|
||||
StatusContentTypeDefault = StatusContentTypePlain
|
||||
)
|
||||
|
||||
// String returns the actual MIME string corresponding to a content type.
|
||||
// NOMERGE: is this actually necessary? i copied this because Visibility has it
|
||||
// but it kinda seems like it's only used as part of the preferences stuff. do i
|
||||
// need to touch that for this
|
||||
func (v StatusContentType) String() string {
|
||||
switch v {
|
||||
case StatusContentTypePlain:
|
||||
return "text/plain"
|
||||
case StatusContentTypeMarkdown:
|
||||
return "text/markdown"
|
||||
default:
|
||||
panic("invalid status content type")
|
||||
}
|
||||
}
|
||||
|
||||
// Content models the simple string content
|
||||
// of a status along with its ContentMap,
|
||||
// which contains content entries keyed by
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue