Transmogrifier: Fix BAD code by RINPATCH
authorlain <lain@soykaf.club>
Tue, 31 Mar 2020 17:33:41 +0000 (19:33 +0200)
committerlain <lain@soykaf.club>
Tue, 31 Mar 2020 17:33:41 +0000 (19:33 +0200)
lib/pleroma/web/activity_pub/transmogrifier.ex

index a18ece6e748c1d7e58dbf5c90a7ca351bf9215ec..a4b385cd5c49917914a8184522fb7c6b243001bb 100644 (file)
@@ -1267,19 +1267,25 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
     {:error, :no_context}
   end
 
-  defp maybe_add_recipients_from_object(%{"to" => [_ | _], "cc" => [_ | _]} = data), do: {:ok, data}
+  defp maybe_add_recipients_from_object(%{"to" => [_ | _], "cc" => [_ | _]} = data),
+    do: {:ok, data}
 
   defp maybe_add_recipients_from_object(%{"object" => object} = data) do
     case Object.normalize(object) do
-      %{data: {"actor" => actor}} -> 
+      %{data: %{"actor" => actor}} ->
         data =
           data
           |> Map.put("to", [actor])
           |> Map.put("cc", data["cc"] || [])
 
         {:ok, data}
-      nil -> {:error, :no_object}
-      _ -> {:error, :no_actor}
+
+      nil ->
+        {:error, :no_object}
+
+      _ ->
+        {:error, :no_actor}
+    end
   end
 
   defp maybe_add_recipients_from_object(_) do