bit more progress
This commit is contained in:
@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user