summaryrefslogtreecommitdiff
path: root/internal/gtsmodel/status.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2021-09-09 16:15:25 +0200
committerLibravatar GitHub <noreply@github.com>2021-09-09 16:15:25 +0200
commit555ea8edfb2c30d149b3ca6cb0fbe53f2798c7bc (patch)
tree24567c4c365a007fcd2d6603e696b363129abb77 /internal/gtsmodel/status.go
parentMerge pull request #198 from NyaaaWhatsUpDoc/update/sqlite-library (diff)
downloadgotosocial-555ea8edfb2c30d149b3ca6cb0fbe53f2798c7bc.tar.xz
Import export (#194)
* start with export/import code * messing about with decoding/encoding * some more fiddling * stuff is WORKING * working pretty alright! * go fmt * fix up tests, add docs * start backup/restore doc * tweaks * credits * update advancedVisibility settings * update bun library -> v1.0.4 Signed-off-by: kim (grufwub) <grufwub@gmail.com> * update oauth library -> v4.3.1-SSB Signed-off-by: kim (grufwub) <grufwub@gmail.com> * handle oauth token scope, fix user.SigninCount + token.UserID Signed-off-by: kim (grufwub) <grufwub@gmail.com> * update oauth library --> v4.3.2-SSB Signed-off-by: kim (grufwub) <grufwub@gmail.com> * update sqlite library -> v1.13.0 Signed-off-by: kim (grufwub) <grufwub@gmail.com> * review changes * start with export/import code * messing about with decoding/encoding * some more fiddling * stuff is WORKING * working pretty alright! * go fmt * fix up tests, add docs * start backup/restore doc * tweaks * credits * update advancedVisibility settings * review changes Co-authored-by: kim (grufwub) <grufwub@gmail.com> Co-authored-by: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>
Diffstat (limited to 'internal/gtsmodel/status.go')
-rw-r--r--internal/gtsmodel/status.go25
1 files changed, 5 insertions, 20 deletions
diff --git a/internal/gtsmodel/status.go b/internal/gtsmodel/status.go
index f298e71cd..38cb6e9c1 100644
--- a/internal/gtsmodel/status.go
+++ b/internal/gtsmodel/status.go
@@ -57,10 +57,13 @@ type Status struct {
Language string `validate:"-" bun:",nullzero"` // what language is this status written in?
CreatedWithApplicationID string `validate:"required_if=Local true,omitempty,ulid" bun:"type:CHAR(26),nullzero"` // Which application was used to create this status?
CreatedWithApplication *Application `validate:"-" bun:"rel:belongs-to"` // application corresponding to createdWithApplicationID
- VisibilityAdvanced VisibilityAdvanced `validate:"required" bun:",nullzero,notnull" ` // advanced visibility for this status
ActivityStreamsType string `validate:"required" 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 `validate:"-" bun:",nullzero"` // Original text of the status without formatting
- Pinned bool `validate:"-" bun:",notnull,default:false" ` // Has this status been pinned by its owner?
+ Pinned bool `validate:"-" bun:",notnull,default:false"` // Has this status been pinned by its owner?
+ Federated bool `validate:"-" bun:",notnull"` // This status will be federated beyond the local timeline(s)
+ Boostable bool `validate:"-" bun:",notnull"` // This status can be boosted/reblogged
+ Replyable bool `validate:"-" bun:",notnull"` // This status can be replied to
+ Likeable bool `validate:"-" bun:",notnull"` // This status can be liked/faved
}
// StatusToTag is an intermediate struct to facilitate the many2many relationship between a status and one or more tags.
@@ -96,21 +99,3 @@ const (
// VisibilityDefault is used when no other setting can be found.
VisibilityDefault Visibility = VisibilityUnlocked
)
-
-// VisibilityAdvanced models flags for fine-tuning visibility and interactivity of a status.
-//
-// All flags default to true.
-//
-// If PUBLIC is selected, flags will all be overwritten to TRUE regardless of what is selected.
-//
-// If UNLOCKED is selected, any flags can be turned on or off in any combination.
-//
-// If FOLLOWERS-ONLY or MUTUALS-ONLY are selected, boostable will always be FALSE. Other flags can be turned on or off as desired.
-//
-// If DIRECT is selected, boostable will be FALSE, and all other flags will be TRUE.
-type VisibilityAdvanced struct {
- Federated bool `validate:"-" bun:",notnull,default:true"` // This status will be federated beyond the local timeline(s)
- Boostable bool `validate:"-" bun:",notnull,default:true"` // This status can be boosted/reblogged
- Replyable bool `validate:"-" bun:",notnull,default:true"` // This status can be replied to
- Likeable bool `validate:"-" bun:",notnull,default:true"` // This status can be liked/faved
-}