From 78c44f31ca10c296dffc22e0b01a2a0cd9e25cfa Mon Sep 17 00:00:00 2001 From: FloatingGhost Date: Wed, 11 Jan 2023 15:25:34 +0000 Subject: [PATCH] fix no-language-specified federation --- lib/pleroma/web/common_api/activity_draft.ex | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/pleroma/web/common_api/activity_draft.ex b/lib/pleroma/web/common_api/activity_draft.ex index adddea669..ced6371d6 100644 --- a/lib/pleroma/web/common_api/activity_draft.ex +++ b/lib/pleroma/web/common_api/activity_draft.ex @@ -145,7 +145,10 @@ defp language(%{params: %{language: language}, content_html: content} = draft) end end - defp language(draft), do: draft + defp language(%{content_html: content} = draft) do + # Use a default language if no language is specified + %__MODULE__{draft | content_map: %{"en" => content}} + end defp visibility(%{params: params} = draft) do case CommonAPI.get_visibility(params, draft.in_reply_to, draft.in_reply_to_conversation) do