Why not allow quoting private messages?

This commit is contained in:
Fox 2023-03-09 13:01:41 +09:00
parent b5b0a0d332
commit 5b801ad3f5

View file

@ -119,14 +119,14 @@ defmodule Pleroma.Web.CommonAPI.ActivityDraft do
defp quote_id(%{params: %{quote_id: id}} = draft) when is_binary(id) do
with {:activity, %Activity{} = quote} <- {:activity, Activity.get_by_id(id)},
visibility <- CommonAPI.get_quoted_visibility(quote),
{:visibility, true} <- {:visibility, visibility in ["public", "unlisted"]} do
{:visibility, true} <- {:visibility, visibility in ["public", "unlisted", "private"]} do
%__MODULE__{draft | quote: Activity.get_by_id(id)}
else
{:activity, _} ->
add_error(draft, dgettext("errors", "You can't quote a status that doesn't exist"))
{:visibility, false} ->
add_error(draft, dgettext("errors", "You can only quote public or unlisted statuses"))
add_error(draft, dgettext("errors", "You can't quote a direct message"))
end
end