diff options
author | lambda <pleromagit@rogerbraun.net> | 2019-02-19 14:08:19 +0000 |
---|---|---|
committer | lambda <pleromagit@rogerbraun.net> | 2019-02-19 14:08:19 +0000 |
commit | f25a3f4f78c9505b14e0e03a6d4ac23a3b497999 (patch) | |
tree | 53cbe65b25b8a4b3a838f67e2984f43bce1c371b | |
parent | f53dc5ee08b5db336738fa73677533785fb7351f (diff) | |
parent | 96dcacade1fb5efd3c5118a1b8510e0cedbfeb85 (diff) | |
download | pleroma-f25a3f4f78c9505b14e0e03a6d4ac23a3b497999.tar.gz |
Merge branch 'fix/check-follower-collection-in-is_private' into 'develop'
properly check for follower address in is_private?
See merge request pleroma/pleroma!841
-rw-r--r-- | lib/pleroma/web/activity_pub/activity_pub.ex | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex index 8fd4c9899..8d3116839 100644 --- a/lib/pleroma/web/activity_pub/activity_pub.ex +++ b/lib/pleroma/web/activity_pub/activity_pub.ex @@ -878,7 +878,12 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do end def is_private?(activity) do - !is_public?(activity) && Enum.any?(activity.data["to"], &String.contains?(&1, "/followers")) + unless is_public?(activity) do + follower_address = User.get_cached_by_ap_id(activity.data["actor"]).follower_address + Enum.any?(activity.data["to"], &(&1 == follower_address)) + else + false + end end def is_direct?(%Activity{data: %{"directMessage" => true}}), do: true |