diff options
author | William Pitcock <nenolod@dereferenced.org> | 2019-01-17 23:17:59 +0000 |
---|---|---|
committer | William Pitcock <nenolod@dereferenced.org> | 2019-01-17 23:21:31 +0000 |
commit | 33b473cc021d2d027c11021178af90298230e06e (patch) | |
tree | be000a9a6d354c3eadc7aa2b7c1e606444aed856 | |
parent | 8e9f1d55876a282aa9f6f5358dc2db8715c13bff (diff) | |
download | pleroma-33b473cc021d2d027c11021178af90298230e06e.tar.gz |
activitypub: allow is_public?() to work on any type of map representing an AS2 object
-rw-r--r-- | lib/pleroma/web/activity_pub/activity_pub.ex | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex index 8c852edbd..92c5ce2ae 100644 --- a/lib/pleroma/web/activity_pub/activity_pub.ex +++ b/lib/pleroma/web/activity_pub/activity_pub.ex @@ -797,13 +797,11 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do end end - def is_public?(%Object{data: %{"type" => "Tombstone"}}) do - false - end + def is_public?(%Object{data: %{"type" => "Tombstone"}}), do: false + def is_public?(%Activity{data: data}), do: is_public?(data) - def is_public?(activity) do - "https://www.w3.org/ns/activitystreams#Public" in (activity.data["to"] ++ - (activity.data["cc"] || [])) + def is_public?(data) do + "https://www.w3.org/ns/activitystreams#Public" in (data["to"] ++ (data["cc"] || [])) end def visible_for_user?(activity, nil) do |