From 53fccb8af8943aa63e557cbd54d2c19c75b63174 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Thu, 22 Aug 2024 19:47:10 +0200 Subject: [feature] Use `local_only` field, deprecate `federated` field (#3222) * [feature] Use `local_only` field, deprecate `federated` field * use `deprecated` comment for form.Federated * nolint --- internal/gtsmodel/status.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'internal/gtsmodel') 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"` -- cgit v1.2.3