From 307d98e3862b6e867eea524b81d5428b03e6607c Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Tue, 10 Sep 2024 14:34:49 +0200 Subject: [feature] Process `Reject` of interaction via fedi API, put rejected statuses in the "sin bin" 😈 (#3271) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [feature] Process `Reject` of interaction via fedi API, put rejected statuses in the "sin bin" * update test * move nil check back to `rejectStatusIRI` --- internal/federation/federatingdb/reject_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'internal/federation/federatingdb/reject_test.go') diff --git a/internal/federation/federatingdb/reject_test.go b/internal/federation/federatingdb/reject_test.go index f51ffaf56..8efa71ca0 100644 --- a/internal/federation/federatingdb/reject_test.go +++ b/internal/federation/federatingdb/reject_test.go @@ -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) -- cgit v1.2.3