relay: use preloaded object since we always have it
authorWilliam Pitcock <nenolod@dereferenced.org>
Sat, 23 Mar 2019 01:33:41 +0000 (01:33 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Sat, 23 Mar 2019 02:28:56 +0000 (02:28 +0000)
lib/pleroma/web/activity_pub/relay.ex

index 01fef71b9c2db04df59219eb647772f53dbf07d9..a7a20ca37612686a3b38ba9dfb352ec6672572dc 100644 (file)
@@ -41,7 +41,7 @@ defmodule Pleroma.Web.ActivityPub.Relay do
 
   def publish(%Activity{data: %{"type" => "Create"}} = activity) do
     with %User{} = user <- get_actor(),
-         %Object{} = object <- Object.normalize(activity.data["object"]["id"]) do
+         %Object{} = object <- Object.normalize(activity) do
       ActivityPub.announce(user, object, nil, true, false)
     else
       e -> Logger.error("error: #{inspect(e)}")