diff --git a/lib/clacks/activitypub/federator.ex b/lib/clacks/activitypub/federator.ex index a8a2837..36cc207 100644 --- a/lib/clacks/activitypub/federator.ex +++ b/lib/clacks/activitypub/federator.ex @@ -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 diff --git a/lib/clacks/user_actions_helper.ex b/lib/clacks/user_actions_helper.ex index 4eda348..faa0d1e 100644 --- a/lib/clacks/user_actions_helper.ex +++ b/lib/clacks/user_actions_helper.ex @@ -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