summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabe Kangas <gabek@real-ity.com>2022-01-12 18:42:33 -0800
committerGabe Kangas <gabek@real-ity.com>2022-01-12 18:42:33 -0800
commit9eecf1c90234ebedaac1f60c961d617a5e252642 (patch)
treeb5ea99cf36bc09378b0b3c53b1bf17408f6dd865
parente8436f063e11b6cb348ab5b018d0ba8932501ca9 (diff)
Handle create requests but immediately throw an error that we ignore them
-rw-r--r--activitypub/inbox/create.go13
-rw-r--r--activitypub/inbox/worker.go8
2 files changed, 16 insertions, 5 deletions
diff --git a/activitypub/inbox/create.go b/activitypub/inbox/create.go
new file mode 100644
index 000000000..3eab72a5e
--- /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 609a0e932..03e5c985f 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)
}
}