+ defp get_recipient_count(message) do
+ recipients = (message["to"] || []) ++ (message["cc"] || [])
+ follower_collection = User.get_cached_by_ap_id(message["actor"]).follower_address
+
+ if Enum.member?(recipients, "https://www.w3.org/ns/activitystreams#Public") do
+ recipients =
+ recipients
+ |> List.delete("https://www.w3.org/ns/activitystreams#Public")
+ |> List.delete(follower_collection)
+
+ {:public, length(recipients)}
+ else
+ recipients =
+ recipients
+ |> List.delete(follower_collection)
+
+ {:not_public, length(recipients)}
+ end
+ end
+
+ @impl true
+ def filter(%{"type" => "Create"} = message) do