Merge branch 'develop' into 'post-languages'

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak 2024-02-02 17:13:15 +00:00 committed by marcin mikołajczak
commit e798be90ac
162 changed files with 1458 additions and 847 deletions

View file

@ -12,11 +12,13 @@ defmodule Pleroma.Web.CommonAPI.ActivityDraft do
alias Pleroma.Web.CommonAPI.Utils
import Pleroma.EctoType.ActivityPub.ObjectValidators.LanguageCode,
only: [is_good_locale_code?: 1]
only: [good_locale_code?: 1]
import Pleroma.Web.Gettext
import Pleroma.Web.Utils.Guards, only: [not_empty_string: 1]
@type t :: %__MODULE__{}
defstruct valid?: true,
errors: [],
user: nil,
@ -241,7 +243,7 @@ defmodule Pleroma.Web.CommonAPI.ActivityDraft do
defp language(draft) do
language = draft.params[:language]
if is_good_locale_code?(language) do
if good_locale_code?(language) do
%__MODULE__{draft | language: language}
else
draft

View file

@ -109,7 +109,7 @@ defmodule Pleroma.Web.CommonAPI.Utils do
def get_to_and_cc(%{visibility: "direct"} = draft) do
# If the OP is a DM already, add the implicit actor.
if draft.in_reply_to && Visibility.is_direct?(draft.in_reply_to) do
if draft.in_reply_to && Visibility.direct?(draft.in_reply_to) do
{Enum.uniq([draft.in_reply_to.data["actor"] | draft.mentions]), []}
else
{draft.mentions, []}