aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorsxsdv1 <sxsdv1@gmail.com>2019-01-05 10:38:38 +0100
committersxsdv1 <sxsdv1@gmail.com>2019-01-05 11:16:05 +0100
commit2d7da5f4375164aa78e221ab054529a04d09e819 (patch)
tree38ddc652e9f986bb7bcbc1a2155ad3cd6d1dc284 /lib
parentba17518a0aff404e265f4aebec1257912ad2750c (diff)
downloadpleroma-2d7da5f4375164aa78e221ab054529a04d09e819.tar.gz
Don't crash on AP request for tombstone
Because tombstone objects has no addressing the is_public?-predicate would cause an error that propagated as a 500 error in the api
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/activity_pub/activity_pub.ex4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex
index 4d754de13..4685f6d95 100644
--- a/lib/pleroma/web/activity_pub/activity_pub.ex
+++ b/lib/pleroma/web/activity_pub/activity_pub.ex
@@ -801,6 +801,10 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
end
end
+ def is_public?(%Object{data: %{"type" => "Tombstone"}}) do
+ false
+ end
+
def is_public?(activity) do
"https://www.w3.org/ns/activitystreams#Public" in (activity.data["to"] ++
(activity.data["cc"] || []))