Fix federating to followers

This commit is contained in:
Shadowfacts 2021-08-25 23:30:22 -04:00
parent 5326951e8a
commit dcadde5e37
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
2 changed files with 4 additions and 5 deletions

View File

@ -18,7 +18,7 @@ defmodule Clacks.ActivityPub.Federator do
addressed_actors =
if actor.data["followers"] in addressed do
addressed = List.delete(addressed, actor.data["followers"])
[actor.followers | addressed]
actor.followers ++ addressed
else
addressed
end

View File

@ -48,12 +48,11 @@ defmodule Clacks.UserActionsHelper do
end
end
@spec get_addressed(String.t(), [{String.t(), Actor.t()}], String.t() | nil) ::
@spec get_addressed(User.t(), [{String.t(), Actor.t()}], String.t() | nil) ::
{[String.t()], [String.t()]}
defp get_addressed(_author, mentions, in_reply_to_actor) do
defp get_addressed(author, mentions, in_reply_to_actor) do
to = [@public | Enum.map(mentions, fn {_, actor} -> actor.ap_id end)]
# todo: followers
cc = []
cc = [Repo.preload(author, :actor).actor.data["followers"]]
to =
case in_reply_to_actor do