If it's an object struct it is already normalized
authorrinpatch <rinpatch@sdf.org>
Wed, 17 Apr 2019 12:11:22 +0000 (15:11 +0300)
committerrinpatch <rinpatch@sdf.org>
Wed, 17 Apr 2019 12:11:22 +0000 (15:11 +0300)
lib/pleroma/object.ex

index 3f1d0fea1f28e67651195f337c09f9f16cf214c2..740d687a3505fc03ea0cc2161aa44bba4a5f8872 100644 (file)
@@ -44,6 +44,7 @@ defmodule Pleroma.Object do
   def normalize(_, fetch_remote \\ true)
   # If we pass an Activity to Object.normalize(), we can try to use the preloaded object.
   # Use this whenever possible, especially when walking graphs in an O(N) loop!
+  def normalize(%Object{} = object, _), do: object
   def normalize(%Activity{object: %Object{} = object}, _), do: object
 
   # A hack for fake activities