From 071eca20ce9527153ed2e549f6198aad32380495 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Mon, 23 Aug 2021 12:46:05 +0200 Subject: Manually approves followers (#146) * update go-fed * update go-fed * manuallyapprovesfollowers * serialize manuallyApprovesFollowers --- testrig/testmodels.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'testrig') diff --git a/testrig/testmodels.go b/testrig/testmodels.go index 220a3d5ac..29a164c50 100644 --- a/testrig/testmodels.go +++ b/testrig/testmodels.go @@ -1274,6 +1274,7 @@ func NewTestFediPeople() map[string]ap.Accountable { "image/jpeg", URLMustParse("https://unknown-instance.com/media/some_header_filename.jpeg"), "image/png", + false, ), } } @@ -1416,7 +1417,8 @@ func newPerson( avatarURL *url.URL, avatarContentType string, headerURL *url.URL, - headerContentType string) ap.Accountable { + headerContentType string, + manuallyApprovesFollowers bool) ap.Accountable { person := streams.NewActivityStreamsPerson() // id should be the activitypub URI of this user @@ -1489,8 +1491,9 @@ func newPerson( person.SetActivityStreamsUrl(urlProp) // manuallyApprovesFollowers - // Will be shown as a locked account. - // TODO: NOT IMPLEMENTED **YET** -- this needs to be added as an activitypub extension to https://github.com/go-fed/activity, see https://github.com/go-fed/activity/tree/master/astool + manuallyApprovesFollowersProp := streams.NewActivityStreamsManuallyApprovesFollowersProperty() + manuallyApprovesFollowersProp.Set(manuallyApprovesFollowers) + person.SetActivityStreamsManuallyApprovesFollowers(manuallyApprovesFollowersProp) // discoverable // Will be shown in the profile directory. @@ -1575,6 +1578,7 @@ func newPerson( headerURLProperty.AppendIRI(headerURL) headerImage.SetActivityStreamsUrl(headerURLProperty) headerProperty.AppendActivityStreamsImage(headerImage) + person.SetActivityStreamsImage(headerProperty) return person } -- cgit v1.3