mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 03:32:25 -05: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:
parent
f8d399cf6a
commit
8ab2b19a94
42 changed files with 3541 additions and 254 deletions
|
|
@ -520,6 +520,27 @@ func SetManuallyApprovesFollowers(with WithManuallyApprovesFollowers, manuallyAp
|
|||
mafProp.Set(manuallyApprovesFollowers)
|
||||
}
|
||||
|
||||
// GetApprovedBy returns the URL contained in
|
||||
// the ApprovedBy property of 'with', if set.
|
||||
func GetApprovedBy(with WithApprovedBy) *url.URL {
|
||||
mafProp := with.GetGoToSocialApprovedBy()
|
||||
if mafProp == nil || !mafProp.IsIRI() {
|
||||
return nil
|
||||
}
|
||||
return mafProp.Get()
|
||||
}
|
||||
|
||||
// SetApprovedBy sets the given url
|
||||
// on the ApprovedBy property of 'with'.
|
||||
func SetApprovedBy(with WithApprovedBy, approvedBy *url.URL) {
|
||||
abProp := with.GetGoToSocialApprovedBy()
|
||||
if abProp == nil {
|
||||
abProp = streams.NewGoToSocialApprovedByProperty()
|
||||
with.SetGoToSocialApprovedBy(abProp)
|
||||
}
|
||||
abProp.Set(approvedBy)
|
||||
}
|
||||
|
||||
// extractIRIs extracts just the AP IRIs from an iterable
|
||||
// property that may contain types (with IRIs) or just IRIs.
|
||||
//
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue