diff options
Diffstat (limited to 'internal/federation')
-rw-r--r-- | internal/federation/federatingdb/create.go | 2 | ||||
-rw-r--r-- | internal/federation/federatingdb/undo.go | 2 | ||||
-rw-r--r-- | internal/federation/federatingprotocol_test.go | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/internal/federation/federatingdb/create.go b/internal/federation/federatingdb/create.go index 25e961bc3..67f076ab3 100644 --- a/internal/federation/federatingdb/create.go +++ b/internal/federation/federatingdb/create.go @@ -103,7 +103,7 @@ func (f *federatingDB) activityBlock(ctx context.Context, asType vocab.Type, rec } block.ID = newID - if err := f.db.Put(ctx, block); err != nil { + if err := f.db.PutBlock(ctx, block); err != nil { return fmt.Errorf("activityBlock: database error inserting block: %s", err) } diff --git a/internal/federation/federatingdb/undo.go b/internal/federation/federatingdb/undo.go index 4cb3d0fa8..792297683 100644 --- a/internal/federation/federatingdb/undo.go +++ b/internal/federation/federatingdb/undo.go @@ -114,7 +114,7 @@ func (f *federatingDB) Undo(ctx context.Context, undo vocab.ActivityStreamsUndo) return errors.New("UNDO: block object account and inbox account were not the same") } // delete any existing BLOCK - if err := f.db.DeleteWhere(ctx, []db.Where{{Key: "uri", Value: gtsBlock.URI}}, >smodel.Block{}); err != nil { + if err := f.db.DeleteBlockByURI(ctx, gtsBlock.URI); err != nil { return fmt.Errorf("UNDO: db error removing block: %s", err) } l.Debug("block undone") diff --git a/internal/federation/federatingprotocol_test.go b/internal/federation/federatingprotocol_test.go index 1eb5f133c..69ce1a6c0 100644 --- a/internal/federation/federatingprotocol_test.go +++ b/internal/federation/federatingprotocol_test.go @@ -312,7 +312,7 @@ func (suite *FederatingProtocolTestSuite) TestBlocked2() { ctxWithOtherInvolvedIRIs := context.WithValue(ctxWithRequestingAccount, ap.ContextOtherInvolvedIRIs, otherInvolvedIRIs) // insert a block from inboxAccount targeting sendingAccount - if err := suite.db.Put(context.Background(), >smodel.Block{ + if err := suite.db.PutBlock(context.Background(), >smodel.Block{ ID: "01G3KBEMJD4VQ2D615MPV7KTRD", URI: "whatever", AccountID: inboxAccount.ID, @@ -350,7 +350,7 @@ func (suite *FederatingProtocolTestSuite) TestBlocked3() { ctxWithOtherInvolvedIRIs := context.WithValue(ctxWithRequestingAccount, ap.ContextOtherInvolvedIRIs, otherInvolvedIRIs) // insert a block from inboxAccount targeting CCed account - if err := suite.db.Put(context.Background(), >smodel.Block{ + if err := suite.db.PutBlock(context.Background(), >smodel.Block{ ID: "01G3KBEMJD4VQ2D615MPV7KTRD", URI: "whatever", AccountID: inboxAccount.ID, |