Skip to content

Take control over your live stream video by running it yourself. Streaming + chat out of the box.

Handle create requests but immediately throw an error that we ignore them

Gabe Kangascb9a0adac950
diff --git a/activitypub/inbox/create.go b/activitypub/inbox/create.go
new file mode 100644
index 0000000000..3eab72a5e3
--- /dev/null
+++ b/activitypub/inbox/create.go
@@ -0,0 +1,13 @@
+package inbox
+
+import (
+ "context"
+
+ "github.com/go-fed/activity/streams/vocab"
+ "github.com/pkg/errors"
+)
+
+func handleCreateRequest(c context.Context, activity vocab.ActivityStreamsCreate) error {
+ iri := activity.GetJSONLDId().GetIRI().String()
+ return errors.New("not handling create request of: " + iri)
+}
diff --git a/activitypub/inbox/worker.go b/activitypub/inbox/worker.go
index 609a0e9327..03e5c985fd 100644
--- a/activitypub/inbox/worker.go
+++ b/activitypub/inbox/worker.go
@@ -24,14 +24,12 @@ func handle(request apmodels.InboxRequest) {
log.Debugln("Error in attempting to verify request", err)
return
} else if !verified {
- log.Errorln("Request failed verification", err)
+ log.Debugln("Request failed verification", err)
return
}
- // c := context.WithValue(context.Background(), "account", request.ForLocalAccount) //nolint
-
- if err := resolvers.Resolve(context.Background(), request.Body, handleUpdateRequest, handleFollowInboxRequest, handleLikeRequest, handleAnnounceRequest, handleUndoInboxRequest); err != nil {
- log.Errorln("resolver error:", err)
+ if err := resolvers.Resolve(context.Background(), request.Body, handleUpdateRequest, handleFollowInboxRequest, handleLikeRequest, handleAnnounceRequest, handleUndoInboxRequest, handleCreateRequest); err != nil {
+ log.Debugln("resolver error:", err)
}
}