summaryrefslogtreecommitdiff
path: root/internal/federation/federatingdb/get.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2021-08-25 15:34:33 +0200
committerLibravatar GitHub <noreply@github.com>2021-08-25 15:34:33 +0200
commit2dc9fc1626507bb54417fc4a1920b847cafb27a2 (patch)
tree4ddeac479b923db38090aac8bd9209f3646851c1 /internal/federation/federatingdb/get.go
parentManually approves followers (#146) (diff)
downloadgotosocial-2dc9fc1626507bb54417fc4a1920b847cafb27a2.tar.xz
Pg to bun (#148)
* start moving to bun * changing more stuff * more * and yet more * tests passing * seems stable now * more big changes * small fix * little fixes
Diffstat (limited to 'internal/federation/federatingdb/get.go')
-rw-r--r--internal/federation/federatingdb/get.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/internal/federation/federatingdb/get.go b/internal/federation/federatingdb/get.go
index 0265080f9..cc04dd851 100644
--- a/internal/federation/federatingdb/get.go
+++ b/internal/federation/federatingdb/get.go
@@ -33,7 +33,7 @@ import (
// Get returns the database entry for the specified id.
//
// The library makes this call only after acquiring a lock first.
-func (f *federatingDB) Get(c context.Context, id *url.URL) (value vocab.Type, err error) {
+func (f *federatingDB) Get(ctx context.Context, id *url.URL) (value vocab.Type, err error) {
l := f.log.WithFields(
logrus.Fields{
"func": "Get",
@@ -43,17 +43,17 @@ func (f *federatingDB) Get(c context.Context, id *url.URL) (value vocab.Type, er
l.Debug("entering GET function")
if util.IsUserPath(id) {
- acct, err := f.db.GetAccountByURI(id.String())
+ acct, err := f.db.GetAccountByURI(ctx, id.String())
if err != nil {
return nil, err
}
l.Debug("is user path! returning account")
- return f.typeConverter.AccountToAS(acct)
+ return f.typeConverter.AccountToAS(ctx, acct)
}
if util.IsFollowersPath(id) {
acct := &gtsmodel.Account{}
- if err := f.db.GetWhere([]db.Where{{Key: "followers_uri", Value: id.String()}}, acct); err != nil {
+ if err := f.db.GetWhere(ctx, []db.Where{{Key: "followers_uri", Value: id.String()}}, acct); err != nil {
return nil, err
}
@@ -62,12 +62,12 @@ func (f *federatingDB) Get(c context.Context, id *url.URL) (value vocab.Type, er
return nil, err
}
- return f.Followers(c, followersURI)
+ return f.Followers(ctx, followersURI)
}
if util.IsFollowingPath(id) {
acct := &gtsmodel.Account{}
- if err := f.db.GetWhere([]db.Where{{Key: "following_uri", Value: id.String()}}, acct); err != nil {
+ if err := f.db.GetWhere(ctx, []db.Where{{Key: "following_uri", Value: id.String()}}, acct); err != nil {
return nil, err
}
@@ -76,7 +76,7 @@ func (f *federatingDB) Get(c context.Context, id *url.URL) (value vocab.Type, er
return nil, err
}
- return f.Following(c, followingURI)
+ return f.Following(ctx, followingURI)
}
return nil, errors.New("could not get")