mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 08:02:26 -05:00
[chore] Deprecate with_approval, always (client API), approvalRequired, always (fedi API) (#4173)
This pull request deprecates `with_approval` and `always` on the client API side, and `approvalRequired` and `always` on the fedi API side, replacing them with `automatic_approval` and `manual_approval` and `automaticApproval` and `manualApproval`, respectively. Back-compat is kept with these deprecated fields, and they're still serialized to the client API and fedi APIs respectively, in addition to the new non-deprecated properties. This will stay the case until v0.21.0 when they'll be removed. For the sake of not doing a massive database migration, the fields are still named `Always` and `WithApproval` in storage. I think this is probably fine! Part of https://codeberg.org/superseriousbusiness/gotosocial/issues/4026 Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4173 Co-authored-by: tobi <tobi.smethurst@protonmail.com> Co-committed-by: tobi <tobi.smethurst@protonmail.com>
This commit is contained in:
parent
5925644ad3
commit
ca12742a7a
28 changed files with 1214 additions and 248 deletions
|
|
@ -228,16 +228,16 @@ func APIInteractionPolicyToInteractionPolicy(
|
|||
|
||||
return >smodel.InteractionPolicy{
|
||||
CanLike: gtsmodel.PolicyRules{
|
||||
Always: canLikeAlways,
|
||||
WithApproval: canLikeWithApproval,
|
||||
AutomaticApproval: canLikeAlways,
|
||||
ManualApproval: canLikeWithApproval,
|
||||
},
|
||||
CanReply: gtsmodel.PolicyRules{
|
||||
Always: canReplyAlways,
|
||||
WithApproval: canReplyWithApproval,
|
||||
AutomaticApproval: canReplyAlways,
|
||||
ManualApproval: canReplyWithApproval,
|
||||
},
|
||||
CanAnnounce: gtsmodel.PolicyRules{
|
||||
Always: canAnnounceAlways,
|
||||
WithApproval: canAnnounceWithApproval,
|
||||
AutomaticApproval: canAnnounceAlways,
|
||||
ManualApproval: canAnnounceWithApproval,
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1928,6 +1928,9 @@ func populateValuesForProp[T ap.WithIRI](
|
|||
|
||||
// InteractionPolicyToASInteractionPolicy returns a
|
||||
// GoToSocial interaction policy suitable for federation.
|
||||
//
|
||||
// Note: This currently includes deprecated properties `always`
|
||||
// and `approvalRequired`. These will be removed in v0.21.0.
|
||||
func (c *Converter) InteractionPolicyToASInteractionPolicy(
|
||||
ctx context.Context,
|
||||
interactionPolicy *gtsmodel.InteractionPolicy,
|
||||
|
|
@ -1942,30 +1945,56 @@ func (c *Converter) InteractionPolicyToASInteractionPolicy(
|
|||
// Build canLike
|
||||
canLike := streams.NewGoToSocialCanLike()
|
||||
|
||||
// Build canLike.always
|
||||
// Build canLike.automaticApproval
|
||||
canLikeAutomaticApprovalProp := streams.NewGoToSocialAutomaticApprovalProperty()
|
||||
if err := populateValuesForProp(
|
||||
canLikeAutomaticApprovalProp,
|
||||
status,
|
||||
interactionPolicy.CanLike.AutomaticApproval,
|
||||
); err != nil {
|
||||
return nil, gtserror.Newf("error setting canLike.automaticApproval: %w", err)
|
||||
}
|
||||
|
||||
// Set canLike.manualApproval
|
||||
canLike.SetGoToSocialAutomaticApproval(canLikeAutomaticApprovalProp)
|
||||
|
||||
// Build canLike.manualApproval
|
||||
canLikeManualApprovalProp := streams.NewGoToSocialManualApprovalProperty()
|
||||
if err := populateValuesForProp(
|
||||
canLikeManualApprovalProp,
|
||||
status,
|
||||
interactionPolicy.CanLike.ManualApproval,
|
||||
); err != nil {
|
||||
return nil, gtserror.Newf("error setting canLike.manualApproval: %w", err)
|
||||
}
|
||||
|
||||
// Set canLike.manualApproval.
|
||||
canLike.SetGoToSocialManualApproval(canLikeManualApprovalProp)
|
||||
|
||||
// deprecated: Build canLike.always
|
||||
canLikeAlwaysProp := streams.NewGoToSocialAlwaysProperty()
|
||||
if err := populateValuesForProp(
|
||||
canLikeAlwaysProp,
|
||||
status,
|
||||
interactionPolicy.CanLike.Always,
|
||||
interactionPolicy.CanLike.AutomaticApproval,
|
||||
); err != nil {
|
||||
return nil, gtserror.Newf("error setting canLike.always: %w", err)
|
||||
}
|
||||
|
||||
// Set canLike.always
|
||||
// deprecated: Set canLike.always
|
||||
canLike.SetGoToSocialAlways(canLikeAlwaysProp)
|
||||
|
||||
// Build canLike.approvalRequired
|
||||
// deprecated: Build canLike.approvalRequired
|
||||
canLikeApprovalRequiredProp := streams.NewGoToSocialApprovalRequiredProperty()
|
||||
if err := populateValuesForProp(
|
||||
canLikeApprovalRequiredProp,
|
||||
status,
|
||||
interactionPolicy.CanLike.WithApproval,
|
||||
interactionPolicy.CanLike.ManualApproval,
|
||||
); err != nil {
|
||||
return nil, gtserror.Newf("error setting canLike.approvalRequired: %w", err)
|
||||
}
|
||||
|
||||
// Set canLike.approvalRequired.
|
||||
// deprecated: Set canLike.approvalRequired.
|
||||
canLike.SetGoToSocialApprovalRequired(canLikeApprovalRequiredProp)
|
||||
|
||||
// Set canLike on the policy.
|
||||
|
|
@ -1980,30 +2009,56 @@ func (c *Converter) InteractionPolicyToASInteractionPolicy(
|
|||
// Build canReply
|
||||
canReply := streams.NewGoToSocialCanReply()
|
||||
|
||||
// Build canReply.always
|
||||
// Build canReply.automaticApproval
|
||||
canReplyAutomaticApprovalProp := streams.NewGoToSocialAutomaticApprovalProperty()
|
||||
if err := populateValuesForProp(
|
||||
canReplyAutomaticApprovalProp,
|
||||
status,
|
||||
interactionPolicy.CanReply.AutomaticApproval,
|
||||
); err != nil {
|
||||
return nil, gtserror.Newf("error setting canReply.automaticApproval: %w", err)
|
||||
}
|
||||
|
||||
// Set canReply.manualApproval
|
||||
canReply.SetGoToSocialAutomaticApproval(canReplyAutomaticApprovalProp)
|
||||
|
||||
// Build canReply.manualApproval
|
||||
canReplyManualApprovalProp := streams.NewGoToSocialManualApprovalProperty()
|
||||
if err := populateValuesForProp(
|
||||
canReplyManualApprovalProp,
|
||||
status,
|
||||
interactionPolicy.CanReply.ManualApproval,
|
||||
); err != nil {
|
||||
return nil, gtserror.Newf("error setting canReply.manualApproval: %w", err)
|
||||
}
|
||||
|
||||
// Set canReply.manualApproval.
|
||||
canReply.SetGoToSocialManualApproval(canReplyManualApprovalProp)
|
||||
|
||||
// deprecated: Build canReply.always
|
||||
canReplyAlwaysProp := streams.NewGoToSocialAlwaysProperty()
|
||||
if err := populateValuesForProp(
|
||||
canReplyAlwaysProp,
|
||||
status,
|
||||
interactionPolicy.CanReply.Always,
|
||||
interactionPolicy.CanReply.AutomaticApproval,
|
||||
); err != nil {
|
||||
return nil, gtserror.Newf("error setting canReply.always: %w", err)
|
||||
}
|
||||
|
||||
// Set canReply.always
|
||||
// deprecated: Set canReply.always
|
||||
canReply.SetGoToSocialAlways(canReplyAlwaysProp)
|
||||
|
||||
// Build canReply.approvalRequired
|
||||
// deprecated: Build canReply.approvalRequired
|
||||
canReplyApprovalRequiredProp := streams.NewGoToSocialApprovalRequiredProperty()
|
||||
if err := populateValuesForProp(
|
||||
canReplyApprovalRequiredProp,
|
||||
status,
|
||||
interactionPolicy.CanReply.WithApproval,
|
||||
interactionPolicy.CanReply.ManualApproval,
|
||||
); err != nil {
|
||||
return nil, gtserror.Newf("error setting canReply.approvalRequired: %w", err)
|
||||
}
|
||||
|
||||
// Set canReply.approvalRequired.
|
||||
// deprecated: Set canReply.approvalRequired.
|
||||
canReply.SetGoToSocialApprovalRequired(canReplyApprovalRequiredProp)
|
||||
|
||||
// Set canReply on the policy.
|
||||
|
|
@ -2018,30 +2073,56 @@ func (c *Converter) InteractionPolicyToASInteractionPolicy(
|
|||
// Build canAnnounce
|
||||
canAnnounce := streams.NewGoToSocialCanAnnounce()
|
||||
|
||||
// Build canAnnounce.always
|
||||
// Build canAnnounce.automaticApproval
|
||||
canAnnounceAutomaticApprovalProp := streams.NewGoToSocialAutomaticApprovalProperty()
|
||||
if err := populateValuesForProp(
|
||||
canAnnounceAutomaticApprovalProp,
|
||||
status,
|
||||
interactionPolicy.CanAnnounce.AutomaticApproval,
|
||||
); err != nil {
|
||||
return nil, gtserror.Newf("error setting canAnnounce.automaticApproval: %w", err)
|
||||
}
|
||||
|
||||
// Set canAnnounce.manualApproval
|
||||
canAnnounce.SetGoToSocialAutomaticApproval(canAnnounceAutomaticApprovalProp)
|
||||
|
||||
// Build canAnnounce.manualApproval
|
||||
canAnnounceManualApprovalProp := streams.NewGoToSocialManualApprovalProperty()
|
||||
if err := populateValuesForProp(
|
||||
canAnnounceManualApprovalProp,
|
||||
status,
|
||||
interactionPolicy.CanAnnounce.ManualApproval,
|
||||
); err != nil {
|
||||
return nil, gtserror.Newf("error setting canAnnounce.manualApproval: %w", err)
|
||||
}
|
||||
|
||||
// Set canAnnounce.manualApproval.
|
||||
canAnnounce.SetGoToSocialManualApproval(canAnnounceManualApprovalProp)
|
||||
|
||||
// deprecated: Build canAnnounce.always
|
||||
canAnnounceAlwaysProp := streams.NewGoToSocialAlwaysProperty()
|
||||
if err := populateValuesForProp(
|
||||
canAnnounceAlwaysProp,
|
||||
status,
|
||||
interactionPolicy.CanAnnounce.Always,
|
||||
interactionPolicy.CanAnnounce.AutomaticApproval,
|
||||
); err != nil {
|
||||
return nil, gtserror.Newf("error setting canAnnounce.always: %w", err)
|
||||
}
|
||||
|
||||
// Set canAnnounce.always
|
||||
// deprecated: Set canAnnounce.always
|
||||
canAnnounce.SetGoToSocialAlways(canAnnounceAlwaysProp)
|
||||
|
||||
// Build canAnnounce.approvalRequired
|
||||
// deprecated: Build canAnnounce.approvalRequired
|
||||
canAnnounceApprovalRequiredProp := streams.NewGoToSocialApprovalRequiredProperty()
|
||||
if err := populateValuesForProp(
|
||||
canAnnounceApprovalRequiredProp,
|
||||
status,
|
||||
interactionPolicy.CanAnnounce.WithApproval,
|
||||
interactionPolicy.CanAnnounce.ManualApproval,
|
||||
); err != nil {
|
||||
return nil, gtserror.Newf("error setting canAnnounce.approvalRequired: %w", err)
|
||||
}
|
||||
|
||||
// Set canAnnounce.approvalRequired.
|
||||
// deprecated: Set canAnnounce.approvalRequired.
|
||||
canAnnounce.SetGoToSocialApprovalRequired(canAnnounceApprovalRequiredProp)
|
||||
|
||||
// Set canAnnounce on the policy.
|
||||
|
|
|
|||
|
|
@ -540,19 +540,31 @@ func (suite *InternalToASTestSuite) TestStatusToAS() {
|
|||
"always": [
|
||||
"https://www.w3.org/ns/activitystreams#Public"
|
||||
],
|
||||
"approvalRequired": []
|
||||
"approvalRequired": [],
|
||||
"automaticApproval": [
|
||||
"https://www.w3.org/ns/activitystreams#Public"
|
||||
],
|
||||
"manualApproval": []
|
||||
},
|
||||
"canLike": {
|
||||
"always": [
|
||||
"https://www.w3.org/ns/activitystreams#Public"
|
||||
],
|
||||
"approvalRequired": []
|
||||
"approvalRequired": [],
|
||||
"automaticApproval": [
|
||||
"https://www.w3.org/ns/activitystreams#Public"
|
||||
],
|
||||
"manualApproval": []
|
||||
},
|
||||
"canReply": {
|
||||
"always": [
|
||||
"https://www.w3.org/ns/activitystreams#Public"
|
||||
],
|
||||
"approvalRequired": []
|
||||
"approvalRequired": [],
|
||||
"automaticApproval": [
|
||||
"https://www.w3.org/ns/activitystreams#Public"
|
||||
],
|
||||
"manualApproval": []
|
||||
}
|
||||
},
|
||||
"published": "2021-10-20T12:40:37+02:00",
|
||||
|
|
@ -630,19 +642,31 @@ func (suite *InternalToASTestSuite) TestStatusWithTagsToASWithIDs() {
|
|||
"always": [
|
||||
"https://www.w3.org/ns/activitystreams#Public"
|
||||
],
|
||||
"approvalRequired": []
|
||||
"approvalRequired": [],
|
||||
"automaticApproval": [
|
||||
"https://www.w3.org/ns/activitystreams#Public"
|
||||
],
|
||||
"manualApproval": []
|
||||
},
|
||||
"canLike": {
|
||||
"always": [
|
||||
"https://www.w3.org/ns/activitystreams#Public"
|
||||
],
|
||||
"approvalRequired": []
|
||||
"approvalRequired": [],
|
||||
"automaticApproval": [
|
||||
"https://www.w3.org/ns/activitystreams#Public"
|
||||
],
|
||||
"manualApproval": []
|
||||
},
|
||||
"canReply": {
|
||||
"always": [
|
||||
"https://www.w3.org/ns/activitystreams#Public"
|
||||
],
|
||||
"approvalRequired": []
|
||||
"approvalRequired": [],
|
||||
"automaticApproval": [
|
||||
"https://www.w3.org/ns/activitystreams#Public"
|
||||
],
|
||||
"manualApproval": []
|
||||
}
|
||||
},
|
||||
"published": "2021-10-20T11:36:45Z",
|
||||
|
|
@ -738,19 +762,31 @@ func (suite *InternalToASTestSuite) TestStatusWithTagsToASFromDB() {
|
|||
"always": [
|
||||
"https://www.w3.org/ns/activitystreams#Public"
|
||||
],
|
||||
"approvalRequired": []
|
||||
"approvalRequired": [],
|
||||
"automaticApproval": [
|
||||
"https://www.w3.org/ns/activitystreams#Public"
|
||||
],
|
||||
"manualApproval": []
|
||||
},
|
||||
"canLike": {
|
||||
"always": [
|
||||
"https://www.w3.org/ns/activitystreams#Public"
|
||||
],
|
||||
"approvalRequired": []
|
||||
"approvalRequired": [],
|
||||
"automaticApproval": [
|
||||
"https://www.w3.org/ns/activitystreams#Public"
|
||||
],
|
||||
"manualApproval": []
|
||||
},
|
||||
"canReply": {
|
||||
"always": [
|
||||
"https://www.w3.org/ns/activitystreams#Public"
|
||||
],
|
||||
"approvalRequired": []
|
||||
"approvalRequired": [],
|
||||
"automaticApproval": [
|
||||
"https://www.w3.org/ns/activitystreams#Public"
|
||||
],
|
||||
"manualApproval": []
|
||||
}
|
||||
},
|
||||
"published": "2021-10-20T11:36:45Z",
|
||||
|
|
@ -831,19 +867,31 @@ func (suite *InternalToASTestSuite) TestStatusToASWithMentions() {
|
|||
"always": [
|
||||
"https://www.w3.org/ns/activitystreams#Public"
|
||||
],
|
||||
"approvalRequired": []
|
||||
"approvalRequired": [],
|
||||
"automaticApproval": [
|
||||
"https://www.w3.org/ns/activitystreams#Public"
|
||||
],
|
||||
"manualApproval": []
|
||||
},
|
||||
"canLike": {
|
||||
"always": [
|
||||
"https://www.w3.org/ns/activitystreams#Public"
|
||||
],
|
||||
"approvalRequired": []
|
||||
"approvalRequired": [],
|
||||
"automaticApproval": [
|
||||
"https://www.w3.org/ns/activitystreams#Public"
|
||||
],
|
||||
"manualApproval": []
|
||||
},
|
||||
"canReply": {
|
||||
"always": [
|
||||
"https://www.w3.org/ns/activitystreams#Public"
|
||||
],
|
||||
"approvalRequired": []
|
||||
"approvalRequired": [],
|
||||
"automaticApproval": [
|
||||
"https://www.w3.org/ns/activitystreams#Public"
|
||||
],
|
||||
"manualApproval": []
|
||||
}
|
||||
},
|
||||
"published": "2021-11-20T13:32:16Z",
|
||||
|
|
|
|||
|
|
@ -2862,19 +2862,29 @@ func (c *Converter) InteractionPolicyToAPIInteractionPolicy(
|
|||
) (*apimodel.InteractionPolicy, error) {
|
||||
apiPolicy := &apimodel.InteractionPolicy{
|
||||
CanFavourite: apimodel.PolicyRules{
|
||||
Always: policyValsToAPIPolicyVals(policy.CanLike.Always),
|
||||
WithApproval: policyValsToAPIPolicyVals(policy.CanLike.WithApproval),
|
||||
AutomaticApproval: policyValsToAPIPolicyVals(policy.CanLike.AutomaticApproval),
|
||||
ManualApproval: policyValsToAPIPolicyVals(policy.CanLike.ManualApproval),
|
||||
},
|
||||
CanReply: apimodel.PolicyRules{
|
||||
Always: policyValsToAPIPolicyVals(policy.CanReply.Always),
|
||||
WithApproval: policyValsToAPIPolicyVals(policy.CanReply.WithApproval),
|
||||
AutomaticApproval: policyValsToAPIPolicyVals(policy.CanReply.AutomaticApproval),
|
||||
ManualApproval: policyValsToAPIPolicyVals(policy.CanReply.ManualApproval),
|
||||
},
|
||||
CanReblog: apimodel.PolicyRules{
|
||||
Always: policyValsToAPIPolicyVals(policy.CanAnnounce.Always),
|
||||
WithApproval: policyValsToAPIPolicyVals(policy.CanAnnounce.WithApproval),
|
||||
AutomaticApproval: policyValsToAPIPolicyVals(policy.CanAnnounce.AutomaticApproval),
|
||||
ManualApproval: policyValsToAPIPolicyVals(policy.CanAnnounce.ManualApproval),
|
||||
},
|
||||
}
|
||||
|
||||
defer func() {
|
||||
// Include deprecated fields for back-compat. TODO: Remove these in 0.21.0.
|
||||
apiPolicy.CanFavourite.Always = apiPolicy.CanFavourite.AutomaticApproval
|
||||
apiPolicy.CanFavourite.WithApproval = apiPolicy.CanFavourite.ManualApproval
|
||||
apiPolicy.CanReply.Always = apiPolicy.CanReply.AutomaticApproval
|
||||
apiPolicy.CanReply.WithApproval = apiPolicy.CanReply.ManualApproval
|
||||
apiPolicy.CanReblog.Always = apiPolicy.CanReblog.AutomaticApproval
|
||||
apiPolicy.CanReblog.WithApproval = apiPolicy.CanReblog.ManualApproval
|
||||
}()
|
||||
|
||||
if status == nil || requester == nil {
|
||||
// We're done here!
|
||||
return apiPolicy, nil
|
||||
|
|
@ -2890,16 +2900,16 @@ func (c *Converter) InteractionPolicyToAPIInteractionPolicy(
|
|||
return nil, err
|
||||
}
|
||||
|
||||
if likeable.Permission == gtsmodel.PolicyPermissionPermitted {
|
||||
if likeable.Permission == gtsmodel.PolicyPermissionAutomaticApproval {
|
||||
// We can do this!
|
||||
apiPolicy.CanFavourite.Always = append(
|
||||
apiPolicy.CanFavourite.Always,
|
||||
apiPolicy.CanFavourite.AutomaticApproval = append(
|
||||
apiPolicy.CanFavourite.AutomaticApproval,
|
||||
apimodel.PolicyValueMe,
|
||||
)
|
||||
} else if likeable.Permission == gtsmodel.PolicyPermissionWithApproval {
|
||||
} else if likeable.Permission == gtsmodel.PolicyPermissionManualApproval {
|
||||
// We can do this with approval.
|
||||
apiPolicy.CanFavourite.WithApproval = append(
|
||||
apiPolicy.CanFavourite.WithApproval,
|
||||
apiPolicy.CanFavourite.ManualApproval = append(
|
||||
apiPolicy.CanFavourite.ManualApproval,
|
||||
apimodel.PolicyValueMe,
|
||||
)
|
||||
}
|
||||
|
|
@ -2910,16 +2920,16 @@ func (c *Converter) InteractionPolicyToAPIInteractionPolicy(
|
|||
return nil, err
|
||||
}
|
||||
|
||||
if replyable.Permission == gtsmodel.PolicyPermissionPermitted {
|
||||
if replyable.Permission == gtsmodel.PolicyPermissionAutomaticApproval {
|
||||
// We can do this!
|
||||
apiPolicy.CanReply.Always = append(
|
||||
apiPolicy.CanReply.Always,
|
||||
apiPolicy.CanReply.AutomaticApproval = append(
|
||||
apiPolicy.CanReply.AutomaticApproval,
|
||||
apimodel.PolicyValueMe,
|
||||
)
|
||||
} else if replyable.Permission == gtsmodel.PolicyPermissionWithApproval {
|
||||
} else if replyable.Permission == gtsmodel.PolicyPermissionManualApproval {
|
||||
// We can do this with approval.
|
||||
apiPolicy.CanReply.WithApproval = append(
|
||||
apiPolicy.CanReply.WithApproval,
|
||||
apiPolicy.CanReply.ManualApproval = append(
|
||||
apiPolicy.CanReply.ManualApproval,
|
||||
apimodel.PolicyValueMe,
|
||||
)
|
||||
}
|
||||
|
|
@ -2930,16 +2940,16 @@ func (c *Converter) InteractionPolicyToAPIInteractionPolicy(
|
|||
return nil, err
|
||||
}
|
||||
|
||||
if boostable.Permission == gtsmodel.PolicyPermissionPermitted {
|
||||
if boostable.Permission == gtsmodel.PolicyPermissionAutomaticApproval {
|
||||
// We can do this!
|
||||
apiPolicy.CanReblog.Always = append(
|
||||
apiPolicy.CanReblog.Always,
|
||||
apiPolicy.CanReblog.AutomaticApproval = append(
|
||||
apiPolicy.CanReblog.AutomaticApproval,
|
||||
apimodel.PolicyValueMe,
|
||||
)
|
||||
} else if boostable.Permission == gtsmodel.PolicyPermissionWithApproval {
|
||||
} else if boostable.Permission == gtsmodel.PolicyPermissionManualApproval {
|
||||
// We can do this with approval.
|
||||
apiPolicy.CanReblog.WithApproval = append(
|
||||
apiPolicy.CanReblog.WithApproval,
|
||||
apiPolicy.CanReblog.ManualApproval = append(
|
||||
apiPolicy.CanReblog.ManualApproval,
|
||||
apimodel.PolicyValueMe,
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -583,6 +583,11 @@ func (suite *InternalToFrontendTestSuite) TestStatusToFrontend() {
|
|||
"content_type": "text/plain",
|
||||
"interaction_policy": {
|
||||
"can_favourite": {
|
||||
"automatic_approval": [
|
||||
"public",
|
||||
"me"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"public",
|
||||
"me"
|
||||
|
|
@ -590,6 +595,11 @@ func (suite *InternalToFrontendTestSuite) TestStatusToFrontend() {
|
|||
"with_approval": []
|
||||
},
|
||||
"can_reply": {
|
||||
"automatic_approval": [
|
||||
"public",
|
||||
"me"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"public",
|
||||
"me"
|
||||
|
|
@ -597,6 +607,11 @@ func (suite *InternalToFrontendTestSuite) TestStatusToFrontend() {
|
|||
"with_approval": []
|
||||
},
|
||||
"can_reblog": {
|
||||
"automatic_approval": [
|
||||
"public",
|
||||
"me"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"public",
|
||||
"me"
|
||||
|
|
@ -731,6 +746,11 @@ func (suite *InternalToFrontendTestSuite) TestStatusToFrontendHTMLContentWarning
|
|||
"content_type": "text/plain",
|
||||
"interaction_policy": {
|
||||
"can_favourite": {
|
||||
"automatic_approval": [
|
||||
"public",
|
||||
"me"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"public",
|
||||
"me"
|
||||
|
|
@ -738,6 +758,11 @@ func (suite *InternalToFrontendTestSuite) TestStatusToFrontendHTMLContentWarning
|
|||
"with_approval": []
|
||||
},
|
||||
"can_reply": {
|
||||
"automatic_approval": [
|
||||
"public",
|
||||
"me"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"public",
|
||||
"me"
|
||||
|
|
@ -745,6 +770,11 @@ func (suite *InternalToFrontendTestSuite) TestStatusToFrontendHTMLContentWarning
|
|||
"with_approval": []
|
||||
},
|
||||
"can_reblog": {
|
||||
"automatic_approval": [
|
||||
"public",
|
||||
"me"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"public",
|
||||
"me"
|
||||
|
|
@ -881,6 +911,11 @@ func (suite *InternalToFrontendTestSuite) TestStatusToFrontendApplicationDeleted
|
|||
"content_type": "text/plain",
|
||||
"interaction_policy": {
|
||||
"can_favourite": {
|
||||
"automatic_approval": [
|
||||
"public",
|
||||
"me"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"public",
|
||||
"me"
|
||||
|
|
@ -888,6 +923,11 @@ func (suite *InternalToFrontendTestSuite) TestStatusToFrontendApplicationDeleted
|
|||
"with_approval": []
|
||||
},
|
||||
"can_reply": {
|
||||
"automatic_approval": [
|
||||
"public",
|
||||
"me"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"public",
|
||||
"me"
|
||||
|
|
@ -895,6 +935,11 @@ func (suite *InternalToFrontendTestSuite) TestStatusToFrontendApplicationDeleted
|
|||
"with_approval": []
|
||||
},
|
||||
"can_reblog": {
|
||||
"automatic_approval": [
|
||||
"public",
|
||||
"me"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"public",
|
||||
"me"
|
||||
|
|
@ -1088,6 +1133,11 @@ func (suite *InternalToFrontendTestSuite) TestWarnFilteredStatusToFrontend() {
|
|||
],
|
||||
"interaction_policy": {
|
||||
"can_favourite": {
|
||||
"automatic_approval": [
|
||||
"public",
|
||||
"me"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"public",
|
||||
"me"
|
||||
|
|
@ -1095,6 +1145,11 @@ func (suite *InternalToFrontendTestSuite) TestWarnFilteredStatusToFrontend() {
|
|||
"with_approval": []
|
||||
},
|
||||
"can_reply": {
|
||||
"automatic_approval": [
|
||||
"public",
|
||||
"me"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"public",
|
||||
"me"
|
||||
|
|
@ -1102,6 +1157,11 @@ func (suite *InternalToFrontendTestSuite) TestWarnFilteredStatusToFrontend() {
|
|||
"with_approval": []
|
||||
},
|
||||
"can_reblog": {
|
||||
"automatic_approval": [
|
||||
"public",
|
||||
"me"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"public",
|
||||
"me"
|
||||
|
|
@ -1274,6 +1334,11 @@ func (suite *InternalToFrontendTestSuite) TestWarnFilteredBoostToFrontend() {
|
|||
],
|
||||
"interaction_policy": {
|
||||
"can_favourite": {
|
||||
"automatic_approval": [
|
||||
"public",
|
||||
"me"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"public",
|
||||
"me"
|
||||
|
|
@ -1281,6 +1346,11 @@ func (suite *InternalToFrontendTestSuite) TestWarnFilteredBoostToFrontend() {
|
|||
"with_approval": []
|
||||
},
|
||||
"can_reply": {
|
||||
"automatic_approval": [
|
||||
"public",
|
||||
"me"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"public",
|
||||
"me"
|
||||
|
|
@ -1288,6 +1358,11 @@ func (suite *InternalToFrontendTestSuite) TestWarnFilteredBoostToFrontend() {
|
|||
"with_approval": []
|
||||
},
|
||||
"can_reblog": {
|
||||
"automatic_approval": [
|
||||
"public",
|
||||
"me"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"public",
|
||||
"me"
|
||||
|
|
@ -1366,6 +1441,11 @@ func (suite *InternalToFrontendTestSuite) TestWarnFilteredBoostToFrontend() {
|
|||
],
|
||||
"interaction_policy": {
|
||||
"can_favourite": {
|
||||
"automatic_approval": [
|
||||
"public",
|
||||
"me"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"public",
|
||||
"me"
|
||||
|
|
@ -1373,6 +1453,11 @@ func (suite *InternalToFrontendTestSuite) TestWarnFilteredBoostToFrontend() {
|
|||
"with_approval": []
|
||||
},
|
||||
"can_reply": {
|
||||
"automatic_approval": [
|
||||
"public",
|
||||
"me"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"public",
|
||||
"me"
|
||||
|
|
@ -1380,6 +1465,11 @@ func (suite *InternalToFrontendTestSuite) TestWarnFilteredBoostToFrontend() {
|
|||
"with_approval": []
|
||||
},
|
||||
"can_reblog": {
|
||||
"automatic_approval": [
|
||||
"public",
|
||||
"me"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"public",
|
||||
"me"
|
||||
|
|
@ -1665,6 +1755,11 @@ func (suite *InternalToFrontendTestSuite) TestStatusToFrontendUnknownAttachments
|
|||
"poll": null,
|
||||
"interaction_policy": {
|
||||
"can_favourite": {
|
||||
"automatic_approval": [
|
||||
"public",
|
||||
"me"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"public",
|
||||
"me"
|
||||
|
|
@ -1672,6 +1767,11 @@ func (suite *InternalToFrontendTestSuite) TestStatusToFrontendUnknownAttachments
|
|||
"with_approval": []
|
||||
},
|
||||
"can_reply": {
|
||||
"automatic_approval": [
|
||||
"public",
|
||||
"me"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"public",
|
||||
"me"
|
||||
|
|
@ -1679,6 +1779,11 @@ func (suite *InternalToFrontendTestSuite) TestStatusToFrontendUnknownAttachments
|
|||
"with_approval": []
|
||||
},
|
||||
"can_reblog": {
|
||||
"automatic_approval": [
|
||||
"public",
|
||||
"me"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"public",
|
||||
"me"
|
||||
|
|
@ -1744,18 +1849,30 @@ func (suite *InternalToFrontendTestSuite) TestStatusToWebStatus() {
|
|||
"poll": null,
|
||||
"interaction_policy": {
|
||||
"can_favourite": {
|
||||
"automatic_approval": [
|
||||
"public"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"public"
|
||||
],
|
||||
"with_approval": []
|
||||
},
|
||||
"can_reply": {
|
||||
"automatic_approval": [
|
||||
"public"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"public"
|
||||
],
|
||||
"with_approval": []
|
||||
},
|
||||
"can_reblog": {
|
||||
"automatic_approval": [
|
||||
"public"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"public"
|
||||
],
|
||||
|
|
@ -1985,6 +2102,11 @@ func (suite *InternalToFrontendTestSuite) TestStatusToFrontendUnknownLanguage()
|
|||
"content_type": "text/plain",
|
||||
"interaction_policy": {
|
||||
"can_favourite": {
|
||||
"automatic_approval": [
|
||||
"public",
|
||||
"me"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"public",
|
||||
"me"
|
||||
|
|
@ -1992,6 +2114,11 @@ func (suite *InternalToFrontendTestSuite) TestStatusToFrontendUnknownLanguage()
|
|||
"with_approval": []
|
||||
},
|
||||
"can_reply": {
|
||||
"automatic_approval": [
|
||||
"public",
|
||||
"me"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"public",
|
||||
"me"
|
||||
|
|
@ -1999,6 +2126,11 @@ func (suite *InternalToFrontendTestSuite) TestStatusToFrontendUnknownLanguage()
|
|||
"with_approval": []
|
||||
},
|
||||
"can_reblog": {
|
||||
"automatic_approval": [
|
||||
"public",
|
||||
"me"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"public",
|
||||
"me"
|
||||
|
|
@ -2084,18 +2216,30 @@ func (suite *InternalToFrontendTestSuite) TestStatusToFrontendPartialInteraction
|
|||
"content_type": "text/plain",
|
||||
"interaction_policy": {
|
||||
"can_favourite": {
|
||||
"automatic_approval": [
|
||||
"author"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"author"
|
||||
],
|
||||
"with_approval": []
|
||||
},
|
||||
"can_reply": {
|
||||
"automatic_approval": [
|
||||
"author"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"author"
|
||||
],
|
||||
"with_approval": []
|
||||
},
|
||||
"can_reblog": {
|
||||
"automatic_approval": [
|
||||
"author"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"author"
|
||||
],
|
||||
|
|
@ -2208,6 +2352,11 @@ func (suite *InternalToFrontendTestSuite) TestStatusToAPIStatusPendingApproval()
|
|||
"content_type": "text/markdown",
|
||||
"interaction_policy": {
|
||||
"can_favourite": {
|
||||
"automatic_approval": [
|
||||
"public",
|
||||
"me"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"public",
|
||||
"me"
|
||||
|
|
@ -2215,6 +2364,11 @@ func (suite *InternalToFrontendTestSuite) TestStatusToAPIStatusPendingApproval()
|
|||
"with_approval": []
|
||||
},
|
||||
"can_reply": {
|
||||
"automatic_approval": [
|
||||
"public",
|
||||
"me"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"public",
|
||||
"me"
|
||||
|
|
@ -2222,6 +2376,11 @@ func (suite *InternalToFrontendTestSuite) TestStatusToAPIStatusPendingApproval()
|
|||
"with_approval": []
|
||||
},
|
||||
"can_reblog": {
|
||||
"automatic_approval": [
|
||||
"public",
|
||||
"me"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"public",
|
||||
"me"
|
||||
|
|
@ -3186,6 +3345,11 @@ func (suite *InternalToFrontendTestSuite) TestAdminReportToFrontend2() {
|
|||
"poll": null,
|
||||
"interaction_policy": {
|
||||
"can_favourite": {
|
||||
"automatic_approval": [
|
||||
"public",
|
||||
"me"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"public",
|
||||
"me"
|
||||
|
|
@ -3193,6 +3357,11 @@ func (suite *InternalToFrontendTestSuite) TestAdminReportToFrontend2() {
|
|||
"with_approval": []
|
||||
},
|
||||
"can_reply": {
|
||||
"automatic_approval": [
|
||||
"public",
|
||||
"me"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"public",
|
||||
"me"
|
||||
|
|
@ -3200,6 +3369,11 @@ func (suite *InternalToFrontendTestSuite) TestAdminReportToFrontend2() {
|
|||
"with_approval": []
|
||||
},
|
||||
"can_reblog": {
|
||||
"automatic_approval": [
|
||||
"public",
|
||||
"me"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"public",
|
||||
"me"
|
||||
|
|
@ -3688,6 +3862,11 @@ func (suite *InternalToFrontendTestSuite) TestIntReqToAPI() {
|
|||
"content_type": "text/plain",
|
||||
"interaction_policy": {
|
||||
"can_favourite": {
|
||||
"automatic_approval": [
|
||||
"public",
|
||||
"me"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"public",
|
||||
"me"
|
||||
|
|
@ -3695,6 +3874,13 @@ func (suite *InternalToFrontendTestSuite) TestIntReqToAPI() {
|
|||
"with_approval": []
|
||||
},
|
||||
"can_reply": {
|
||||
"automatic_approval": [
|
||||
"author",
|
||||
"me"
|
||||
],
|
||||
"manual_approval": [
|
||||
"public"
|
||||
],
|
||||
"always": [
|
||||
"author",
|
||||
"me"
|
||||
|
|
@ -3704,6 +3890,11 @@ func (suite *InternalToFrontendTestSuite) TestIntReqToAPI() {
|
|||
]
|
||||
},
|
||||
"can_reblog": {
|
||||
"automatic_approval": [
|
||||
"public",
|
||||
"me"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"public",
|
||||
"me"
|
||||
|
|
@ -3787,6 +3978,11 @@ func (suite *InternalToFrontendTestSuite) TestIntReqToAPI() {
|
|||
"content_type": "text/markdown",
|
||||
"interaction_policy": {
|
||||
"can_favourite": {
|
||||
"automatic_approval": [
|
||||
"public",
|
||||
"me"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"public",
|
||||
"me"
|
||||
|
|
@ -3794,6 +3990,11 @@ func (suite *InternalToFrontendTestSuite) TestIntReqToAPI() {
|
|||
"with_approval": []
|
||||
},
|
||||
"can_reply": {
|
||||
"automatic_approval": [
|
||||
"public",
|
||||
"me"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"public",
|
||||
"me"
|
||||
|
|
@ -3801,6 +4002,11 @@ func (suite *InternalToFrontendTestSuite) TestIntReqToAPI() {
|
|||
"with_approval": []
|
||||
},
|
||||
"can_reblog": {
|
||||
"automatic_approval": [
|
||||
"public",
|
||||
"me"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"public",
|
||||
"me"
|
||||
|
|
@ -3947,6 +4153,11 @@ func (suite *InternalToFrontendTestSuite) TestConversationToAPISelfConvo() {
|
|||
"content_type": "text/plain",
|
||||
"interaction_policy": {
|
||||
"can_favourite": {
|
||||
"automatic_approval": [
|
||||
"public",
|
||||
"me"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"public",
|
||||
"me"
|
||||
|
|
@ -3954,6 +4165,11 @@ func (suite *InternalToFrontendTestSuite) TestConversationToAPISelfConvo() {
|
|||
"with_approval": []
|
||||
},
|
||||
"can_reply": {
|
||||
"automatic_approval": [
|
||||
"public",
|
||||
"me"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"public",
|
||||
"me"
|
||||
|
|
@ -3961,6 +4177,11 @@ func (suite *InternalToFrontendTestSuite) TestConversationToAPISelfConvo() {
|
|||
"with_approval": []
|
||||
},
|
||||
"can_reblog": {
|
||||
"automatic_approval": [
|
||||
"public",
|
||||
"me"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"public",
|
||||
"me"
|
||||
|
|
@ -4117,6 +4338,11 @@ func (suite *InternalToFrontendTestSuite) TestConversationToAPI() {
|
|||
"content_type": "text/plain",
|
||||
"interaction_policy": {
|
||||
"can_favourite": {
|
||||
"automatic_approval": [
|
||||
"public",
|
||||
"me"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"public",
|
||||
"me"
|
||||
|
|
@ -4124,6 +4350,11 @@ func (suite *InternalToFrontendTestSuite) TestConversationToAPI() {
|
|||
"with_approval": []
|
||||
},
|
||||
"can_reply": {
|
||||
"automatic_approval": [
|
||||
"public",
|
||||
"me"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"public",
|
||||
"me"
|
||||
|
|
@ -4131,6 +4362,11 @@ func (suite *InternalToFrontendTestSuite) TestConversationToAPI() {
|
|||
"with_approval": []
|
||||
},
|
||||
"can_reblog": {
|
||||
"automatic_approval": [
|
||||
"public",
|
||||
"me"
|
||||
],
|
||||
"manual_approval": [],
|
||||
"always": [
|
||||
"public",
|
||||
"me"
|
||||
|
|
|
|||
|
|
@ -100,19 +100,31 @@ func (suite *WrapTestSuite) TestWrapNoteInCreate() {
|
|||
"always": [
|
||||
"https://www.w3.org/ns/activitystreams#Public"
|
||||
],
|
||||
"approvalRequired": []
|
||||
"approvalRequired": [],
|
||||
"automaticApproval": [
|
||||
"https://www.w3.org/ns/activitystreams#Public"
|
||||
],
|
||||
"manualApproval": []
|
||||
},
|
||||
"canLike": {
|
||||
"always": [
|
||||
"https://www.w3.org/ns/activitystreams#Public"
|
||||
],
|
||||
"approvalRequired": []
|
||||
"approvalRequired": [],
|
||||
"automaticApproval": [
|
||||
"https://www.w3.org/ns/activitystreams#Public"
|
||||
],
|
||||
"manualApproval": []
|
||||
},
|
||||
"canReply": {
|
||||
"always": [
|
||||
"https://www.w3.org/ns/activitystreams#Public"
|
||||
],
|
||||
"approvalRequired": []
|
||||
"approvalRequired": [],
|
||||
"automaticApproval": [
|
||||
"https://www.w3.org/ns/activitystreams#Public"
|
||||
],
|
||||
"manualApproval": []
|
||||
}
|
||||
},
|
||||
"published": "2021-10-20T12:40:37+02:00",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue