summaryrefslogtreecommitdiff
path: root/internal/processing/account
diff options
context:
space:
mode:
Diffstat (limited to 'internal/processing/account')
-rw-r--r--internal/processing/account/create.go2
-rw-r--r--internal/processing/account/get.go12
-rw-r--r--internal/processing/account/getfollowers.go2
-rw-r--r--internal/processing/account/getfollowing.go2
-rw-r--r--internal/processing/account/getrelationship.go2
-rw-r--r--internal/processing/account/getstatuses.go4
-rw-r--r--internal/processing/account/update.go6
7 files changed, 15 insertions, 15 deletions
diff --git a/internal/processing/account/create.go b/internal/processing/account/create.go
index 37c742b45..9eb618994 100644
--- a/internal/processing/account/create.go
+++ b/internal/processing/account/create.go
@@ -60,7 +60,7 @@ func (p *processor) Create(ctx context.Context, applicationToken oauth2.TokenInf
}
l.Tracef("generating a token for user %s with account %s and application %s", user.ID, user.AccountID, application.ID)
- accessToken, err := p.oauthServer.GenerateUserAccessToken(applicationToken, application.ClientSecret, user.ID)
+ accessToken, err := p.oauthServer.GenerateUserAccessToken(ctx, applicationToken, application.ClientSecret, user.ID)
if err != nil {
return nil, fmt.Errorf("error creating new access token for user %s: %s", user.ID, err)
}
diff --git a/internal/processing/account/get.go b/internal/processing/account/get.go
index 5f039127c..dd56df356 100644
--- a/internal/processing/account/get.go
+++ b/internal/processing/account/get.go
@@ -45,13 +45,13 @@ func (p *processor) Get(ctx context.Context, requestingAccount *gtsmodel.Account
}
}
- var mastoAccount *apimodel.Account
+ var apiAccount *apimodel.Account
if blocked {
- mastoAccount, err = p.tc.AccountToMastoBlocked(ctx, targetAccount)
+ apiAccount, err = p.tc.AccountToAPIAccountBlocked(ctx, targetAccount)
if err != nil {
return nil, fmt.Errorf("error converting account: %s", err)
}
- return mastoAccount, nil
+ return apiAccount, nil
}
// last-minute check to make sure we have remote account header/avi cached
@@ -63,12 +63,12 @@ func (p *processor) Get(ctx context.Context, requestingAccount *gtsmodel.Account
}
if requestingAccount != nil && targetAccount.ID == requestingAccount.ID {
- mastoAccount, err = p.tc.AccountToMastoSensitive(ctx, targetAccount)
+ apiAccount, err = p.tc.AccountToAPIAccountSensitive(ctx, targetAccount)
} else {
- mastoAccount, err = p.tc.AccountToMastoPublic(ctx, targetAccount)
+ apiAccount, err = p.tc.AccountToAPIAccountPublic(ctx, targetAccount)
}
if err != nil {
return nil, fmt.Errorf("error converting account: %s", err)
}
- return mastoAccount, nil
+ return apiAccount, nil
}
diff --git a/internal/processing/account/getfollowers.go b/internal/processing/account/getfollowers.go
index 517467085..bcc607290 100644
--- a/internal/processing/account/getfollowers.go
+++ b/internal/processing/account/getfollowers.go
@@ -64,7 +64,7 @@ func (p *processor) FollowersGet(ctx context.Context, requestingAccount *gtsmode
f.Account = a
}
- account, err := p.tc.AccountToMastoPublic(ctx, f.Account)
+ account, err := p.tc.AccountToAPIAccountPublic(ctx, f.Account)
if err != nil {
return nil, gtserror.NewErrorInternalError(err)
}
diff --git a/internal/processing/account/getfollowing.go b/internal/processing/account/getfollowing.go
index 543213f90..d7e9d5f63 100644
--- a/internal/processing/account/getfollowing.go
+++ b/internal/processing/account/getfollowing.go
@@ -64,7 +64,7 @@ func (p *processor) FollowingGet(ctx context.Context, requestingAccount *gtsmode
f.TargetAccount = a
}
- account, err := p.tc.AccountToMastoPublic(ctx, f.TargetAccount)
+ account, err := p.tc.AccountToAPIAccountPublic(ctx, f.TargetAccount)
if err != nil {
return nil, gtserror.NewErrorInternalError(err)
}
diff --git a/internal/processing/account/getrelationship.go b/internal/processing/account/getrelationship.go
index ebfd9b479..9f23cd070 100644
--- a/internal/processing/account/getrelationship.go
+++ b/internal/processing/account/getrelationship.go
@@ -38,7 +38,7 @@ func (p *processor) RelationshipGet(ctx context.Context, requestingAccount *gtsm
return nil, gtserror.NewErrorInternalError(fmt.Errorf("error getting relationship: %s", err))
}
- r, err := p.tc.RelationshipToMasto(ctx, gtsR)
+ r, err := p.tc.RelationshipToAPIRelationship(ctx, gtsR)
if err != nil {
return nil, gtserror.NewErrorInternalError(fmt.Errorf("error converting relationship: %s", err))
}
diff --git a/internal/processing/account/getstatuses.go b/internal/processing/account/getstatuses.go
index dc157e43c..56b5b0eae 100644
--- a/internal/processing/account/getstatuses.go
+++ b/internal/processing/account/getstatuses.go
@@ -51,9 +51,9 @@ func (p *processor) StatusesGet(ctx context.Context, requestingAccount *gtsmodel
continue
}
- apiStatus, err := p.tc.StatusToMasto(ctx, s, requestingAccount)
+ apiStatus, err := p.tc.StatusToAPIStatus(ctx, s, requestingAccount)
if err != nil {
- return nil, gtserror.NewErrorInternalError(fmt.Errorf("error converting status to masto: %s", err))
+ return nil, gtserror.NewErrorInternalError(fmt.Errorf("error converting status to api: %s", err))
}
apiStatuses = append(apiStatuses, *apiStatus)
diff --git a/internal/processing/account/update.go b/internal/processing/account/update.go
index 6dc288849..1ab25787f 100644
--- a/internal/processing/account/update.go
+++ b/internal/processing/account/update.go
@@ -105,7 +105,7 @@ func (p *processor) Update(ctx context.Context, account *gtsmodel.Account, form
if err := validate.Privacy(*form.Source.Privacy); err != nil {
return nil, err
}
- privacy := p.tc.MastoVisToVis(apimodel.Visibility(*form.Source.Privacy))
+ privacy := p.tc.APIVisToVis(apimodel.Visibility(*form.Source.Privacy))
account.Privacy = privacy
}
}
@@ -122,9 +122,9 @@ func (p *processor) Update(ctx context.Context, account *gtsmodel.Account, form
OriginAccount: updatedAccount,
}
- acctSensitive, err := p.tc.AccountToMastoSensitive(ctx, updatedAccount)
+ acctSensitive, err := p.tc.AccountToAPIAccountSensitive(ctx, updatedAccount)
if err != nil {
- return nil, fmt.Errorf("could not convert account into mastosensitive account: %s", err)
+ return nil, fmt.Errorf("could not convert account into apisensitive account: %s", err)
}
return acctSensitive, nil
}