projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1ce1b7b
)
properly check for follower address in is_private?
author
rinpatch
<rinpatch@sdf.org>
Tue, 19 Feb 2019 10:23:13 +0000
(13:23 +0300)
committer
rinpatch
<rinpatch@sdf.org>
Tue, 19 Feb 2019 10:23:13 +0000
(13:23 +0300)
lib/pleroma/web/activity_pub/activity_pub.ex
patch
|
blob
|
history
diff --git
a/lib/pleroma/web/activity_pub/activity_pub.ex
b/lib/pleroma/web/activity_pub/activity_pub.ex
index ab2872f56aadcc36e87da85c0ccc795b469e10dc..839b6ce2ad165f21a3f1d9decee4950f6b44c11f 100644
(file)
--- 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