[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

@ -146,7 +146,7 @@ func (f *federate) DeleteAccount(ctx context.Context, account *gtsmodel.Account)
func (f *federate) CreateStatus(ctx context.Context, status *gtsmodel.Status) error {
// Do nothing if the status
// shouldn't be federated.
if !*status.Federated {
if status.IsLocalOnly() {
return nil
}
@ -201,7 +201,7 @@ func (f *federate) CreatePollVote(ctx context.Context, poll *gtsmodel.Poll, vote
// Do nothing if the status
// shouldn't be federated.
if !*status.Federated {
if status.IsLocalOnly() {
return nil
}
@ -234,7 +234,7 @@ func (f *federate) CreatePollVote(ctx context.Context, poll *gtsmodel.Poll, vote
func (f *federate) DeleteStatus(ctx context.Context, status *gtsmodel.Status) error {
// Do nothing if the status
// shouldn't be federated.
if !*status.Federated {
if status.IsLocalOnly() {
return nil
}
@ -272,7 +272,7 @@ func (f *federate) DeleteStatus(ctx context.Context, status *gtsmodel.Status) er
func (f *federate) UpdateStatus(ctx context.Context, status *gtsmodel.Status) error {
// Do nothing if the status
// shouldn't be federated.
if !*status.Federated {
if status.IsLocalOnly() {
return nil
}