fix no-language-specified federation
authorFloatingGhost <hannah@coffee-and-dreams.uk>
Wed, 11 Jan 2023 15:25:34 +0000 (15:25 +0000)
committerFloatingGhost <hannah@coffee-and-dreams.uk>
Wed, 11 Jan 2023 15:25:34 +0000 (15:25 +0000)
lib/pleroma/web/common_api/activity_draft.ex

index adddea669f59595415255f73cb5cec0854b39da9..ced6371d6c7da0f8a2d039aa6d284cdb4cd2c62d 100644 (file)
@@ -145,7 +145,10 @@ defmodule Pleroma.Web.CommonAPI.ActivityDraft do
     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