Use pseudo ap id of a list in BCC

This commit is contained in:
Egor Kislitsyn 2019-05-13 16:15:14 +07:00
commit 23276e8d68
5 changed files with 92 additions and 24 deletions

View file

@ -8,7 +8,6 @@ defmodule Pleroma.Web.CommonAPI.Utils do
alias Pleroma.Activity
alias Pleroma.Config
alias Pleroma.Formatter
alias Pleroma.List
alias Pleroma.Object
alias Pleroma.Repo
alias Pleroma.User
@ -106,16 +105,10 @@ defmodule Pleroma.Web.CommonAPI.Utils do
def to_for_user_and_mentions(_user, _mentions, _inReplyTo, _), do: {[], []}
def bcc_for_list(user, {:list, list_id}) do
with {_, %List{} = list} <- {:list, List.get(list_id, user)},
{:ok, following} <- List.get_following(list) do
{:ok, Enum.map(following, & &1.ap_id)}
else
{:list, _} -> {:error, "List not found"}
err -> err
end
[Pleroma.List.ap_id(user, list_id)]
end
def bcc_for_list(_, _), do: {:ok, []}
def bcc_for_list(_, _), do: []
def make_content_html(
status,