From: rinpatch Date: Wed, 17 Apr 2019 12:11:22 +0000 (+0300) Subject: If it's an object struct it is already normalized X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=c3a20528060e4fb95292dd93768d9afc8926e66e;p=akkoma If it's an object struct it is already normalized --- diff --git a/lib/pleroma/object.ex b/lib/pleroma/object.ex index 3f1d0fea1..740d687a3 100644 --- a/lib/pleroma/object.ex +++ b/lib/pleroma/object.ex @@ -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