Add addressable lists

This commit is contained in:
Egor Kislitsyn 2019-05-01 16:11:17 +07:00
commit a3dc02d282
5 changed files with 92 additions and 38 deletions

View file

@ -8,6 +8,7 @@ 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
@ -102,6 +103,20 @@ defmodule Pleroma.Web.CommonAPI.Utils do
end
end
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
end
def bcc_for_list(_, _), do: {:ok, []}
def make_content_html(
status,
attachments,