[feature] Use local_only field, deprecate federated field (#3222)

* [feature] Use `local_only` field, deprecate `federated` field

* use `deprecated` comment for form.Federated

* nolint
This commit is contained in:
tobi 2024-08-22 19:47:10 +02:00 committed by GitHub
commit 53fccb8af8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 233 additions and 171 deletions

View file

@ -212,6 +212,12 @@ func (s *Status) IsLocal() bool {
return s.Local != nil && *s.Local
}
// IsLocalOnly returns true if this status
// is "local-only" ie., unfederated.
func (s *Status) IsLocalOnly() bool {
return s.Federated == nil || !*s.Federated
}
// StatusToTag is an intermediate struct to facilitate the many2many relationship between a status and one or more tags.
type StatusToTag struct {
StatusID string `bun:"type:CHAR(26),unique:statustag,nullzero,notnull"`