[feature] Process Reject of interaction via fedi API, put rejected statuses in the "sin bin" 😈 (#3271)

* [feature] Process `Reject` of interaction via fedi API, put rejected statuses in the "sin bin"

* update test

* move nil check back to `rejectStatusIRI`
This commit is contained in:
tobi
2024-09-10 14:34:49 +02:00
committed by GitHub
parent 3254ef1923
commit 307d98e386
21 changed files with 1172 additions and 115 deletions

View File

@ -23,6 +23,7 @@ import (
"github.com/stretchr/testify/suite"
"github.com/superseriousbusiness/activity/streams"
"github.com/superseriousbusiness/gotosocial/internal/ap"
"github.com/superseriousbusiness/gotosocial/internal/db"
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
"github.com/superseriousbusiness/gotosocial/internal/uris"
@ -61,10 +62,11 @@ func (suite *RejectTestSuite) TestRejectFollowRequest() {
// create a Reject
reject := streams.NewActivityStreamsReject()
// set an ID on it
ap.SetJSONLDId(reject, testrig.URLMustParse("https://example.org/some/reject/id"))
// set the rejecting actor on it
acceptActorProp := streams.NewActivityStreamsActorProperty()
acceptActorProp.AppendIRI(rejectingAccountURI)
reject.SetActivityStreamsActor(acceptActorProp)
ap.AppendActorIRIs(reject, rejectingAccountURI)
// Set the recreated follow as the 'object' property.
acceptObject := streams.NewActivityStreamsObjectProperty()
@ -72,9 +74,7 @@ func (suite *RejectTestSuite) TestRejectFollowRequest() {
reject.SetActivityStreamsObject(acceptObject)
// Set the To of the reject as the originator of the follow
acceptTo := streams.NewActivityStreamsToProperty()
acceptTo.AppendIRI(requestingAccountURI)
reject.SetActivityStreamsTo(acceptTo)
ap.AppendTo(reject, requestingAccountURI)
// process the reject in the federating database
err = suite.federatingDB.Reject(ctx, reject)