[chore] remove type switch in Create() and instead move to FederatedCallbacks() (#3697)

* remove type switch in Create() and instead move to FederatedCallbacks()

* add missing (my bad!) federating wrapped callbacks behaviour

* add missing license header 😇

* fix create flag test to use correct function
This commit is contained in:
kim 2025-01-28 20:22:23 +00:00 committed by GitHub
commit 61141ac232
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 610 additions and 433 deletions

View file

@ -25,6 +25,7 @@ import (
"github.com/stretchr/testify/suite"
"github.com/superseriousbusiness/activity/streams"
"github.com/superseriousbusiness/activity/streams/vocab"
"github.com/superseriousbusiness/gotosocial/internal/ap"
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
"github.com/superseriousbusiness/gotosocial/internal/id"
@ -115,8 +116,10 @@ func (suite *CreateTestSuite) TestCreateFlag1() {
suite.FailNow(err.Error())
}
flag := t.(vocab.ActivityStreamsFlag)
ctx := createTestContext(reportedAccount, reportingAccount)
if err := suite.federatingDB.Create(ctx, t); err != nil {
if err := suite.federatingDB.Flag(ctx, flag); err != nil {
suite.FailNow(err.Error())
}