summaryrefslogtreecommitdiff
path: root/internal/ap/interfaces.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2024-02-06 10:45:46 +0100
committerLibravatar GitHub <noreply@github.com>2024-02-06 09:45:46 +0000
commitaa396c78d30c129bb2145765d3990571dbc025bb (patch)
treec2046f00c80b029d4f44a1eaf97ca2e960a492cf /internal/ap/interfaces.go
parent[chore]: Bump github.com/miekg/dns from 1.1.57 to 1.1.58 (#2606) (diff)
downloadgotosocial-aa396c78d30c129bb2145765d3990571dbc025bb.tar.xz
[feature] serdes for moved/also_known_as (#2600)
* [feature] serdes for moved/also_known_as * document `alsoKnownAs` and `movedTo` properties * only implicitly populate AKA uris from DB for local accounts * don't let remotes store more than 20 AKA uris to avoid shenanigans
Diffstat (limited to 'internal/ap/interfaces.go')
-rw-r--r--internal/ap/interfaces.go22
1 files changed, 21 insertions, 1 deletions
diff --git a/internal/ap/interfaces.go b/internal/ap/interfaces.go
index 45ddbfba7..811e09125 100644
--- a/internal/ap/interfaces.go
+++ b/internal/ap/interfaces.go
@@ -160,6 +160,8 @@ type Accountable interface {
WithFollowing
WithFollowers
WithFeatured
+ WithMovedTo
+ WithAlsoKnownAs
WithManuallyApprovesFollowers
WithEndpoints
WithTag
@@ -327,7 +329,7 @@ type TypeOrIRI interface {
}
// Property represents the minimum interface for an ActivityStreams property with IRIs.
-type Property[T TypeOrIRI] interface {
+type Property[T WithIRI] interface {
Len() int
At(int) T
@@ -441,6 +443,18 @@ type WithFeatured interface {
SetTootFeatured(vocab.TootFeaturedProperty)
}
+// WithMovedTo represents an Object with ActivityStreamsMovedToProperty.
+type WithMovedTo interface {
+ GetActivityStreamsMovedTo() vocab.ActivityStreamsMovedToProperty
+ SetActivityStreamsMovedTo(vocab.ActivityStreamsMovedToProperty)
+}
+
+// WithAlsoKnownAs represents an Object with ActivityStreamsAlsoKnownAsProperty.
+type WithAlsoKnownAs interface {
+ GetActivityStreamsAlsoKnownAs() vocab.ActivityStreamsAlsoKnownAsProperty
+ SetActivityStreamsAlsoKnownAs(vocab.ActivityStreamsAlsoKnownAsProperty)
+}
+
// WithAttributedTo represents an activity with ActivityStreamsAttributedToProperty
type WithAttributedTo interface {
GetActivityStreamsAttributedTo() vocab.ActivityStreamsAttributedToProperty
@@ -551,6 +565,12 @@ type WithObject interface {
SetActivityStreamsObject(vocab.ActivityStreamsObjectProperty)
}
+// WithTarget represents an activity with ActivityStreamsTargetProperty
+type WithTarget interface {
+ GetActivityStreamsTarget() vocab.ActivityStreamsTargetProperty
+ SetActivityStreamsTarget(vocab.ActivityStreamsTargetProperty)
+}
+
// WithNext represents an activity with ActivityStreamsNextProperty
type WithNext interface {
GetActivityStreamsNext() vocab.ActivityStreamsNextProperty