mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[feature] Federate interaction policies + Accepts; enforce policies (#3138)
* [feature] Federate interaction policies + Accepts; enforce policies * use Acceptable type * fix index * remove appendIRIStrs * add GetAccept federatingdb function * lock on object IRI
This commit is contained in:
@ -393,13 +393,23 @@ func (c *Converter) ASStatusToStatus(ctx context.Context, statusable ap.Statusab
|
||||
return nil, gtserror.SetMalformed(err)
|
||||
}
|
||||
|
||||
// Advanced visibility toggles for this status.
|
||||
//
|
||||
// TODO: a lot of work to be done here -- a new type
|
||||
// needs to be created for this in go-fed/activity.
|
||||
// Until this is implemented, assume all true.
|
||||
// Status was sent to us or dereffed
|
||||
// by us so it must be federated.
|
||||
status.Federated = util.Ptr(true)
|
||||
|
||||
// Derive interaction policy for this status.
|
||||
status.InteractionPolicy = ap.ExtractInteractionPolicy(
|
||||
statusable,
|
||||
status.Account,
|
||||
)
|
||||
|
||||
// Set approvedByURI if present,
|
||||
// for later dereferencing.
|
||||
approvedByURI := ap.GetApprovedBy(statusable)
|
||||
if approvedByURI != nil {
|
||||
status.ApprovedByURI = approvedByURI.String()
|
||||
}
|
||||
|
||||
// status.Sensitive
|
||||
sensitive := ap.ExtractSensitive(statusable)
|
||||
status.Sensitive = &sensitive
|
||||
|
Reference in New Issue
Block a user