diff options
Diffstat (limited to 'internal/gtsmodel')
| -rw-r--r-- | internal/gtsmodel/status.go | 11 | ||||
| -rw-r--r-- | internal/gtsmodel/statusedit.go | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/internal/gtsmodel/status.go b/internal/gtsmodel/status.go index e170e7464..424a0065f 100644 --- a/internal/gtsmodel/status.go +++ b/internal/gtsmodel/status.go @@ -69,6 +69,7 @@ type Status struct { CreatedWithApplication *Application `bun:"rel:belongs-to"` // application corresponding to createdWithApplicationID ActivityStreamsType string `bun:",nullzero,notnull"` // What is the activitystreams type of this status? See: https://www.w3.org/TR/activitystreams-vocabulary/#object-types. Will probably almost always be Note but who knows!. Text string `bun:""` // Original text of the status without formatting + ContentType StatusContentType `bun:",nullzero"` // Content type used to process the original text of the status Federated *bool `bun:",notnull"` // This status will be federated beyond the local timeline(s) InteractionPolicy *InteractionPolicy `bun:""` // InteractionPolicy for this status. If null then the default InteractionPolicy should be assumed for this status's Visibility. Always null for boost wrappers. 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. @@ -376,6 +377,16 @@ 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 ( + StatusContentTypePlain StatusContentType = 1 + StatusContentTypeMarkdown StatusContentType = 2 + StatusContentTypeDefault = StatusContentTypePlain +) + // Content models the simple string content // of a status along with its ContentMap, // which contains content entries keyed by diff --git a/internal/gtsmodel/statusedit.go b/internal/gtsmodel/statusedit.go index 199d47736..9c31495eb 100644 --- a/internal/gtsmodel/statusedit.go +++ b/internal/gtsmodel/statusedit.go @@ -31,6 +31,7 @@ type StatusEdit struct { Content string `bun:""` // Content of status at time of edit; likely html-formatted but not guaranteed. ContentWarning string `bun:",nullzero"` // Content warning of status at time of edit. Text string `bun:""` // Original status text, without formatting, at time of edit. + ContentType StatusContentType `bun:",nullzero"` // Content type used to process the original text of the status. Language string `bun:",nullzero"` // Status language at time of edit. Sensitive *bool `bun:",nullzero,notnull,default:false"` // Status sensitive flag at time of edit. AttachmentIDs []string `bun:"attachments,array"` // Database IDs of media attachments associated with status at time of edit. |
