aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorrinpatch <rinpatch@sdf.org>2019-11-30 10:41:18 +0000
committerrinpatch <rinpatch@sdf.org>2019-11-30 10:41:18 +0000
commitcf0c861d0012f27ae555247834187d509d7a7114 (patch)
tree369c00656ea4f6d40864f3fe5483fbe6c749e5ab /lib
parentb21738d4c08b2f0d66944e3f74a15f3a3985b37a (diff)
parent1915b23e72c5cbed5c794f66eb0a727e719d3c57 (diff)
downloadpleroma-cf0c861d0012f27ae555247834187d509d7a7114.tar.gz
Merge branch 'hide-relation-for-friendica' into 'develop'
Hide relation for friendica users See merge request pleroma/pleroma!2026
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/activity_pub/activity_pub.ex10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex
index f25314ff6..f32d04175 100644
--- a/lib/pleroma/web/activity_pub/activity_pub.ex
+++ b/lib/pleroma/web/activity_pub/activity_pub.ex
@@ -1233,13 +1233,13 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
end
end
- defp collection_private(data) do
- if is_map(data["first"]) and
- data["first"]["type"] in ["CollectionPage", "OrderedCollectionPage"] do
+ defp collection_private(%{"first" => first}) do
+ if is_map(first) and
+ first["type"] in ["CollectionPage", "OrderedCollectionPage"] do
{:ok, false}
else
with {:ok, %{"type" => type}} when type in ["CollectionPage", "OrderedCollectionPage"] <-
- Fetcher.fetch_and_contain_remote_object_from_id(data["first"]) do
+ Fetcher.fetch_and_contain_remote_object_from_id(first) do
{:ok, false}
else
{:error, {:ok, %{status: code}}} when code in [401, 403] ->
@@ -1254,6 +1254,8 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
end
end
+ defp collection_private(_data), do: {:ok, true}
+
def user_data_from_user_object(data) do
with {:ok, data} <- MRF.filter(data),
{:ok, data} <- object_to_user_data(data) do