diff options
author | rinpatch <rinpatch@sdf.org> | 2019-02-19 13:23:13 +0300 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2019-02-19 13:23:13 +0300 |
commit | 96dcacade1fb5efd3c5118a1b8510e0cedbfeb85 (patch) | |
tree | e19323a391f3c66f9989ba9a2fda87a24fbf0990 /lib | |
parent | 1ce1b7b58dc0e009635c9dd6e2571df56c04f356 (diff) | |
download | pleroma-96dcacade1fb5efd3c5118a1b8510e0cedbfeb85.tar.gz |
properly check for follower address in is_private?
Diffstat (limited to 'lib')
-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 ab2872f56..839b6ce2a 100644 --- a/lib/pleroma/web/activity_pub/activity_pub.ex +++ b/lib/pleroma/web/activity_pub/activity_pub.ex @@ -876,7 +876,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 |