diff options
Diffstat (limited to 'internal/processing/status')
-rw-r--r-- | internal/processing/status/boost.go | 4 | ||||
-rw-r--r-- | internal/processing/status/boostedby.go | 10 | ||||
-rw-r--r-- | internal/processing/status/context.go | 8 | ||||
-rw-r--r-- | internal/processing/status/create.go | 4 | ||||
-rw-r--r-- | internal/processing/status/delete.go | 4 | ||||
-rw-r--r-- | internal/processing/status/fave.go | 6 | ||||
-rw-r--r-- | internal/processing/status/favedby.go | 10 | ||||
-rw-r--r-- | internal/processing/status/get.go | 4 | ||||
-rw-r--r-- | internal/processing/status/unboost.go | 4 | ||||
-rw-r--r-- | internal/processing/status/unfave.go | 4 | ||||
-rw-r--r-- | internal/processing/status/util.go | 2 |
11 files changed, 30 insertions, 30 deletions
diff --git a/internal/processing/status/boost.go b/internal/processing/status/boost.go index 4276ca9fa..2ee6acd55 100644 --- a/internal/processing/status/boost.go +++ b/internal/processing/status/boost.go @@ -74,10 +74,10 @@ func (p *processor) Boost(ctx context.Context, requestingAccount *gtsmodel.Accou } // return the frontend representation of the new status to the submitter - mastoStatus, err := p.tc.StatusToMasto(ctx, boostWrapperStatus, requestingAccount) + apiStatus, err := p.tc.StatusToAPIStatus(ctx, boostWrapperStatus, requestingAccount) if err != nil { return nil, gtserror.NewErrorInternalError(fmt.Errorf("error converting status %s to frontend representation: %s", targetStatus.ID, err)) } - return mastoStatus, nil + return apiStatus, nil } diff --git a/internal/processing/status/boostedby.go b/internal/processing/status/boostedby.go index 46f41039f..00256d2dd 100644 --- a/internal/processing/status/boostedby.go +++ b/internal/processing/status/boostedby.go @@ -64,15 +64,15 @@ func (p *processor) BoostedBy(ctx context.Context, requestingAccount *gtsmodel.A // TODO: filter other things here? suspended? muted? silenced? - // now we can return the masto representation of those accounts - mastoAccounts := []*apimodel.Account{} + // now we can return the api representation of those accounts + apiAccounts := []*apimodel.Account{} for _, acc := range filteredAccounts { - mastoAccount, err := p.tc.AccountToMastoPublic(ctx, acc) + apiAccount, err := p.tc.AccountToAPIAccountPublic(ctx, acc) if err != nil { return nil, gtserror.NewErrorNotFound(fmt.Errorf("StatusFavedBy: error converting account to api model: %s", err)) } - mastoAccounts = append(mastoAccounts, mastoAccount) + apiAccounts = append(apiAccounts, apiAccount) } - return mastoAccounts, nil + return apiAccounts, nil } diff --git a/internal/processing/status/context.go b/internal/processing/status/context.go index 3e8e93d09..75c756cfe 100644 --- a/internal/processing/status/context.go +++ b/internal/processing/status/context.go @@ -58,9 +58,9 @@ func (p *processor) Context(ctx context.Context, requestingAccount *gtsmodel.Acc for _, status := range parents { if v, err := p.filter.StatusVisible(ctx, status, requestingAccount); err == nil && v { - mastoStatus, err := p.tc.StatusToMasto(ctx, status, requestingAccount) + apiStatus, err := p.tc.StatusToAPIStatus(ctx, status, requestingAccount) if err == nil { - context.Ancestors = append(context.Ancestors, *mastoStatus) + context.Ancestors = append(context.Ancestors, *apiStatus) } } } @@ -76,9 +76,9 @@ func (p *processor) Context(ctx context.Context, requestingAccount *gtsmodel.Acc for _, status := range children { if v, err := p.filter.StatusVisible(ctx, status, requestingAccount); err == nil && v { - mastoStatus, err := p.tc.StatusToMasto(ctx, status, requestingAccount) + apiStatus, err := p.tc.StatusToAPIStatus(ctx, status, requestingAccount) if err == nil { - context.Descendants = append(context.Descendants, *mastoStatus) + context.Descendants = append(context.Descendants, *apiStatus) } } } diff --git a/internal/processing/status/create.go b/internal/processing/status/create.go index a87dbc7fe..655be5b17 100644 --- a/internal/processing/status/create.go +++ b/internal/processing/status/create.go @@ -105,10 +105,10 @@ func (p *processor) Create(ctx context.Context, account *gtsmodel.Account, appli } // return the frontend representation of the new status to the submitter - mastoStatus, err := p.tc.StatusToMasto(ctx, newStatus, account) + apiStatus, err := p.tc.StatusToAPIStatus(ctx, newStatus, account) if err != nil { return nil, gtserror.NewErrorInternalError(fmt.Errorf("error converting status %s to frontend representation: %s", newStatus.ID, err)) } - return mastoStatus, nil + return apiStatus, nil } diff --git a/internal/processing/status/delete.go b/internal/processing/status/delete.go index dfb2c3626..822e1559c 100644 --- a/internal/processing/status/delete.go +++ b/internal/processing/status/delete.go @@ -43,7 +43,7 @@ func (p *processor) Delete(ctx context.Context, requestingAccount *gtsmodel.Acco return nil, gtserror.NewErrorForbidden(errors.New("status doesn't belong to requesting account")) } - mastoStatus, err := p.tc.StatusToMasto(ctx, targetStatus, requestingAccount) + apiStatus, err := p.tc.StatusToAPIStatus(ctx, targetStatus, requestingAccount) if err != nil { return nil, gtserror.NewErrorInternalError(fmt.Errorf("error converting status %s to frontend representation: %s", targetStatus.ID, err)) } @@ -61,5 +61,5 @@ func (p *processor) Delete(ctx context.Context, requestingAccount *gtsmodel.Acco TargetAccount: requestingAccount, } - return mastoStatus, nil + return apiStatus, nil } diff --git a/internal/processing/status/fave.go b/internal/processing/status/fave.go index f3f10c43c..571e0715c 100644 --- a/internal/processing/status/fave.go +++ b/internal/processing/status/fave.go @@ -93,11 +93,11 @@ func (p *processor) Fave(ctx context.Context, requestingAccount *gtsmodel.Accoun } } - // return the mastodon representation of the target status - mastoStatus, err := p.tc.StatusToMasto(ctx, targetStatus, requestingAccount) + // return the apidon representation of the target status + apiStatus, err := p.tc.StatusToAPIStatus(ctx, targetStatus, requestingAccount) if err != nil { return nil, gtserror.NewErrorInternalError(fmt.Errorf("error converting status %s to frontend representation: %s", targetStatus.ID, err)) } - return mastoStatus, nil + return apiStatus, nil } diff --git a/internal/processing/status/favedby.go b/internal/processing/status/favedby.go index 227fb669d..e8681e379 100644 --- a/internal/processing/status/favedby.go +++ b/internal/processing/status/favedby.go @@ -62,15 +62,15 @@ func (p *processor) FavedBy(ctx context.Context, requestingAccount *gtsmodel.Acc } } - // now we can return the masto representation of those accounts - mastoAccounts := []*apimodel.Account{} + // now we can return the api representation of those accounts + apiAccounts := []*apimodel.Account{} for _, acc := range filteredAccounts { - mastoAccount, err := p.tc.AccountToMastoPublic(ctx, acc) + apiAccount, err := p.tc.AccountToAPIAccountPublic(ctx, acc) if err != nil { return nil, gtserror.NewErrorInternalError(fmt.Errorf("error converting status %s to frontend representation: %s", targetStatus.ID, err)) } - mastoAccounts = append(mastoAccounts, mastoAccount) + apiAccounts = append(apiAccounts, apiAccount) } - return mastoAccounts, nil + return apiAccounts, nil } diff --git a/internal/processing/status/get.go b/internal/processing/status/get.go index 258210faf..fb9a3ea77 100644 --- a/internal/processing/status/get.go +++ b/internal/processing/status/get.go @@ -45,10 +45,10 @@ func (p *processor) Get(ctx context.Context, requestingAccount *gtsmodel.Account return nil, gtserror.NewErrorNotFound(errors.New("status is not visible")) } - mastoStatus, err := p.tc.StatusToMasto(ctx, targetStatus, requestingAccount) + apiStatus, err := p.tc.StatusToAPIStatus(ctx, targetStatus, requestingAccount) if err != nil { return nil, gtserror.NewErrorInternalError(fmt.Errorf("error converting status %s to frontend representation: %s", targetStatus.ID, err)) } - return mastoStatus, nil + return apiStatus, nil } diff --git a/internal/processing/status/unboost.go b/internal/processing/status/unboost.go index 13c24d638..94e74f8e0 100644 --- a/internal/processing/status/unboost.go +++ b/internal/processing/status/unboost.go @@ -100,10 +100,10 @@ func (p *processor) Unboost(ctx context.Context, requestingAccount *gtsmodel.Acc } } - mastoStatus, err := p.tc.StatusToMasto(ctx, targetStatus, requestingAccount) + apiStatus, err := p.tc.StatusToAPIStatus(ctx, targetStatus, requestingAccount) if err != nil { return nil, gtserror.NewErrorInternalError(fmt.Errorf("error converting status %s to frontend representation: %s", targetStatus.ID, err)) } - return mastoStatus, nil + return apiStatus, nil } diff --git a/internal/processing/status/unfave.go b/internal/processing/status/unfave.go index 27ce9b156..a8ddea39d 100644 --- a/internal/processing/status/unfave.go +++ b/internal/processing/status/unfave.go @@ -82,10 +82,10 @@ func (p *processor) Unfave(ctx context.Context, requestingAccount *gtsmodel.Acco } } - mastoStatus, err := p.tc.StatusToMasto(ctx, targetStatus, requestingAccount) + apiStatus, err := p.tc.StatusToAPIStatus(ctx, targetStatus, requestingAccount) if err != nil { return nil, gtserror.NewErrorInternalError(fmt.Errorf("error converting status %s to frontend representation: %s", targetStatus.ID, err)) } - return mastoStatus, nil + return apiStatus, nil } diff --git a/internal/processing/status/util.go b/internal/processing/status/util.go index edbb9a31a..e655632db 100644 --- a/internal/processing/status/util.go +++ b/internal/processing/status/util.go @@ -42,7 +42,7 @@ func (p *processor) ProcessVisibility(ctx context.Context, form *apimodel.Advanc // If visibility isn't set on the form, then just take the account default. // If that's also not set, take the default for the whole instance. if form.Visibility != "" { - vis = p.tc.MastoVisToVis(form.Visibility) + vis = p.tc.APIVisToVis(form.Visibility) } else if accountDefaultVis != "" { vis = accountDefaultVis } else { |