diff options
author | 2024-08-22 19:47:10 +0200 | |
---|---|---|
committer | 2024-08-22 19:47:10 +0200 | |
commit | 53fccb8af8943aa63e557cbd54d2c19c75b63174 (patch) | |
tree | 5a3dad5bfb03df895a1a45c69d8fe8acc33abab6 /internal/gtsmodel/status.go | |
parent | [bugfix/frontend] Small safari + gnome web fixes (#3219) (diff) | |
download | gotosocial-53fccb8af8943aa63e557cbd54d2c19c75b63174.tar.xz |
[feature] Use `local_only` field, deprecate `federated` field (#3222)
* [feature] Use `local_only` field, deprecate `federated` field
* use `deprecated` comment for form.Federated
* nolint
Diffstat (limited to 'internal/gtsmodel/status.go')
-rw-r--r-- | internal/gtsmodel/status.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/gtsmodel/status.go b/internal/gtsmodel/status.go index 5f50fb046..70fd9c367 100644 --- a/internal/gtsmodel/status.go +++ b/internal/gtsmodel/status.go @@ -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"` |