bit more progress

This commit is contained in:
tsmethurst
2021-06-03 10:57:24 +02:00
parent c23075cac2
commit 5acca2a735
11 changed files with 99 additions and 98 deletions

View File

@ -101,16 +101,19 @@ func (f *federatingDB) Create(ctx context.Context, asType vocab.Type) error {
}
if err := f.db.Put(status); err != nil {
if _, ok := err.(db.ErrAlreadyExists); ok {
// the status already exists in the database, which means we've already handled everything else,
// so we can just return nil here and be done with it.
return nil
}
// an actual error has happened
return fmt.Errorf("database error inserting status: %s", err)
}
fromFederatorChan <- gtsmodel.FromFederator{
APObjectType: gtsmodel.ActivityStreamsNote,
APActivityType: gtsmodel.ActivityStreamsCreate,
GTSModel: status,
ReceivingAccount: targetAcct,
APObjectType: gtsmodel.ActivityStreamsNote,
APActivityType: gtsmodel.ActivityStreamsCreate,
GTSModel: status,
ReceivingAccount: targetAcct,
}
}
}

View File

@ -43,7 +43,7 @@ func (f *federatingDB) Followers(c context.Context, actorIRI *url.URL) (follower
}
acctFollowers := []gtsmodel.Follow{}
if err := f.db.GetFollowersByAccountID(acct.ID, &acctFollowers); err != nil {
if err := f.db.GetFollowersByAccountID(acct.ID, &acctFollowers, false); err != nil {
return nil, fmt.Errorf("db error getting followers for account id %s: %s", acct.ID, err)
}