summaryrefslogtreecommitdiff
path: root/internal/federation/federatingdb/owns.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2023-03-01 18:26:53 +0000
committerLibravatar GitHub <noreply@github.com>2023-03-01 18:26:53 +0000
commitbaf933cb9f3e1053bdb61b90d7027efe9fad1bc2 (patch)
tree3f2a76851d58517ca3dece2bacd6aceefd8dfb96 /internal/federation/federatingdb/owns.go
parent[feature] Federate pinned posts (aka `featuredCollection`) in and out (#1560) (diff)
downloadgotosocial-baf933cb9f3e1053bdb61b90d7027efe9fad1bc2.tar.xz
[chore] move client/federator workerpools to Workers{} (#1575)
* replace concurrency worker pools with base models in State.Workers, update code and tests accordingly * improve code comment * change back testrig default log level * un-comment-out TestAnnounceTwice() and fix --------- Signed-off-by: kim <grufwub@gmail.com> Reviewed-by: tobi
Diffstat (limited to 'internal/federation/federatingdb/owns.go')
-rw-r--r--internal/federation/federatingdb/owns.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/internal/federation/federatingdb/owns.go b/internal/federation/federatingdb/owns.go
index def0fa518..2c11e8148 100644
--- a/internal/federation/federatingdb/owns.go
+++ b/internal/federation/federatingdb/owns.go
@@ -54,7 +54,7 @@ func (f *federatingDB) Owns(ctx context.Context, id *url.URL) (bool, error) {
if err != nil {
return false, fmt.Errorf("error parsing statuses path for url %s: %s", id.String(), err)
}
- status, err := f.db.GetStatusByURI(ctx, uid)
+ status, err := f.state.DB.GetStatusByURI(ctx, uid)
if err != nil {
if err == db.ErrNoEntries {
// there are no entries for this status
@@ -71,7 +71,7 @@ func (f *federatingDB) Owns(ctx context.Context, id *url.URL) (bool, error) {
if err != nil {
return false, fmt.Errorf("error parsing statuses path for url %s: %s", id.String(), err)
}
- if _, err := f.db.GetAccountByUsernameDomain(ctx, username, ""); err != nil {
+ if _, err := f.state.DB.GetAccountByUsernameDomain(ctx, username, ""); err != nil {
if err == db.ErrNoEntries {
// there are no entries for this username
return false, nil
@@ -88,7 +88,7 @@ func (f *federatingDB) Owns(ctx context.Context, id *url.URL) (bool, error) {
if err != nil {
return false, fmt.Errorf("error parsing statuses path for url %s: %s", id.String(), err)
}
- if _, err := f.db.GetAccountByUsernameDomain(ctx, username, ""); err != nil {
+ if _, err := f.state.DB.GetAccountByUsernameDomain(ctx, username, ""); err != nil {
if err == db.ErrNoEntries {
// there are no entries for this username
return false, nil
@@ -105,7 +105,7 @@ func (f *federatingDB) Owns(ctx context.Context, id *url.URL) (bool, error) {
if err != nil {
return false, fmt.Errorf("error parsing statuses path for url %s: %s", id.String(), err)
}
- if _, err := f.db.GetAccountByUsernameDomain(ctx, username, ""); err != nil {
+ if _, err := f.state.DB.GetAccountByUsernameDomain(ctx, username, ""); err != nil {
if err == db.ErrNoEntries {
// there are no entries for this username
return false, nil
@@ -122,7 +122,7 @@ func (f *federatingDB) Owns(ctx context.Context, id *url.URL) (bool, error) {
if err != nil {
return false, fmt.Errorf("error parsing like path for url %s: %s", id.String(), err)
}
- if _, err := f.db.GetAccountByUsernameDomain(ctx, username, ""); err != nil {
+ if _, err := f.state.DB.GetAccountByUsernameDomain(ctx, username, ""); err != nil {
if err == db.ErrNoEntries {
// there are no entries for this username
return false, nil
@@ -130,7 +130,7 @@ func (f *federatingDB) Owns(ctx context.Context, id *url.URL) (bool, error) {
// an actual error happened
return false, fmt.Errorf("database error fetching account with username %s: %s", username, err)
}
- if err := f.db.GetByID(ctx, likeID, &gtsmodel.StatusFave{}); err != nil {
+ if err := f.state.DB.GetByID(ctx, likeID, &gtsmodel.StatusFave{}); err != nil {
if err == db.ErrNoEntries {
// there are no entries
return false, nil
@@ -147,7 +147,7 @@ func (f *federatingDB) Owns(ctx context.Context, id *url.URL) (bool, error) {
if err != nil {
return false, fmt.Errorf("error parsing block path for url %s: %s", id.String(), err)
}
- if _, err := f.db.GetAccountByUsernameDomain(ctx, username, ""); err != nil {
+ if _, err := f.state.DB.GetAccountByUsernameDomain(ctx, username, ""); err != nil {
if err == db.ErrNoEntries {
// there are no entries for this username
return false, nil
@@ -155,7 +155,7 @@ func (f *federatingDB) Owns(ctx context.Context, id *url.URL) (bool, error) {
// an actual error happened
return false, fmt.Errorf("database error fetching account with username %s: %s", username, err)
}
- if err := f.db.GetByID(ctx, blockID, &gtsmodel.Block{}); err != nil {
+ if err := f.state.DB.GetByID(ctx, blockID, &gtsmodel.Block{}); err != nil {
if err == db.ErrNoEntries {
// there are no entries
return false, nil