projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Credo fixes.
[akkoma]
/
lib
/
pleroma
/
web
/
activity_pub
/
builder.ex
diff --git
a/lib/pleroma/web/activity_pub/builder.ex
b/lib/pleroma/web/activity_pub/builder.ex
index a40054921055f366975dc80a52e5d209b8a3b94a..1aac62c69e446d3162020c20c50e6d237210dbe9 100644
(file)
--- a/
lib/pleroma/web/activity_pub/builder.ex
+++ b/
lib/pleroma/web/activity_pub/builder.ex
@@
-8,6
+8,7
@@
defmodule Pleroma.Web.ActivityPub.Builder do
alias Pleroma.Emoji
alias Pleroma.Object
alias Pleroma.User
alias Pleroma.Emoji
alias Pleroma.Object
alias Pleroma.User
+ alias Pleroma.Web.ActivityPub.Relay
alias Pleroma.Web.ActivityPub.Utils
alias Pleroma.Web.ActivityPub.Visibility
alias Pleroma.Web.ActivityPub.Utils
alias Pleroma.Web.ActivityPub.Visibility
@@
-122,15
+123,20
@@
defmodule Pleroma.Web.ActivityPub.Builder do
end
end
end
end
+ @spec announce(User.t(), Object.t(), keyword()) :: {:ok, map(), keyword()}
def announce(actor, object, options \\ []) do
public? = Keyword.get(options, :public, false)
def announce(actor, object, options \\ []) do
public? = Keyword.get(options, :public, false)
- to = [actor.follower_address, object.data["actor"]]
to =
to =
- if public? do
- [Pleroma.Constants.as_public() | to]
- else
- to
+ cond do
+ actor.ap_id == Relay.relay_ap_id() ->
+ [actor.follower_address]
+
+ public? ->
+ [actor.follower_address, object.data["actor"], Pleroma.Constants.as_public()]
+
+ true ->
+ [actor.follower_address, object.data["actor"]]
end
{:ok,
end
{:ok,