summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabe Kangas <gabek@real-ity.com>2022-01-04 21:20:26 -0800
committerGabe Kangas <gabek@real-ity.com>2022-01-06 23:02:49 -0800
commitd01a2e29c6501a4682e60af0a128d86583228edb (patch)
tree67afab32416c723d4a739fa47f0c996f3425dfca
parent280e6d1e85fb37147b1635ea5e85088b182c9f7e (diff)
Save follow references to inbound activities table
-rw-r--r--activitypub/inbox/follow.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/activitypub/inbox/follow.go b/activitypub/inbox/follow.go
index 2194dc3db..3d849865e 100644
--- a/activitypub/inbox/follow.go
+++ b/activitypub/inbox/follow.go
@@ -3,6 +3,7 @@ package inbox
import (
"context"
"fmt"
+ "time"
"github.com/go-fed/activity/streams/vocab"
"github.com/owncast/owncast/activitypub/persistence"
@@ -44,8 +45,14 @@ func handleFollowInboxRequest(c context.Context, activity vocab.ActivityStreamsF
}
}
+ // Save as an accepted activity
actorReference := activity.GetActivityStreamsActor()
-
+ object := activity.GetActivityStreamsObject()
+ objectIRI := object.At(0).GetIRI().String()
+ actorIRI := actorReference.At(0).GetIRI().String()
+ if err := persistence.SaveInboundFediverseActivity(objectIRI, actorIRI, events.FediverseEngagementFollow, time.Now()); err != nil {
+ return errors.Wrap(err, "unable to save inbound share/re-post activity")
+ }
if approved {
return handleEngagementActivity(events.FediverseEngagementFollow, false, actorReference, events.FediverseEngagementFollow)
}