summaryrefslogtreecommitdiff
path: root/internal/typeutils/astointernal.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2024-07-26 12:04:28 +0200
committerLibravatar GitHub <noreply@github.com>2024-07-26 12:04:28 +0200
commit8ab2b19a946251f258446d22f420d401f61d22f6 (patch)
tree39fb674f135fd1cfcf4de5b319913f0d0c17d11a /internal/typeutils/astointernal.go
parent[docs] Add separate migration section + instructions for moving to GtS and no... (diff)
downloadgotosocial-8ab2b19a946251f258446d22f420d401f61d22f6.tar.xz
[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
Diffstat (limited to 'internal/typeutils/astointernal.go')
-rw-r--r--internal/typeutils/astointernal.go20
1 files changed, 15 insertions, 5 deletions
diff --git a/internal/typeutils/astointernal.go b/internal/typeutils/astointernal.go
index cb3e320d9..2946c8d09 100644
--- a/internal/typeutils/astointernal.go
+++ b/internal/typeutils/astointernal.go
@@ -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