summaryrefslogtreecommitdiff
path: root/internal/federation/federatingdb/inbox.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/inbox.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/inbox.go')
-rw-r--r--internal/federation/federatingdb/inbox.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/federation/federatingdb/inbox.go b/internal/federation/federatingdb/inbox.go
index 5ec735bd4..1a6da4ef0 100644
--- a/internal/federation/federatingdb/inbox.go
+++ b/internal/federation/federatingdb/inbox.go
@@ -85,12 +85,12 @@ func (f *federatingDB) InboxesForIRI(c context.Context, iri *url.URL) (inboxIRIs
return nil, fmt.Errorf("couldn't extract local account username from uri %s: %s", iri, err)
}
- account, err := f.db.GetAccountByUsernameDomain(c, localAccountUsername, "")
+ account, err := f.state.DB.GetAccountByUsernameDomain(c, localAccountUsername, "")
if err != nil {
return nil, fmt.Errorf("couldn't find local account with username %s: %s", localAccountUsername, err)
}
- follows, err := f.db.GetAccountFollowedBy(c, account.ID, false)
+ follows, err := f.state.DB.GetAccountFollowedBy(c, account.ID, false)
if err != nil {
return nil, fmt.Errorf("couldn't get followers of local account %s: %s", localAccountUsername, err)
}
@@ -98,7 +98,7 @@ func (f *federatingDB) InboxesForIRI(c context.Context, iri *url.URL) (inboxIRIs
for _, follow := range follows {
// make sure we retrieved the following account from the db
if follow.Account == nil {
- followingAccount, err := f.db.GetAccountByID(c, follow.AccountID)
+ followingAccount, err := f.state.DB.GetAccountByID(c, follow.AccountID)
if err != nil {
if err == db.ErrNoEntries {
continue
@@ -126,7 +126,7 @@ func (f *federatingDB) InboxesForIRI(c context.Context, iri *url.URL) (inboxIRIs
}
// check if this is just an account IRI...
- if account, err := f.db.GetAccountByURI(c, iri.String()); err == nil {
+ if account, err := f.state.DB.GetAccountByURI(c, iri.String()); err == nil {
// deliver to a shared inbox if we have that option
var inbox string
if config.GetInstanceDeliverToSharedInboxes() && account.SharedInboxURI != nil && *account.SharedInboxURI != "" {