From: William Pitcock Date: Mon, 6 Aug 2018 08:03:10 +0000 (+0000) Subject: relay: only relay create activities X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=2b628f23410edc310d10e692ae0502136e999fd3;p=akkoma relay: only relay create activities --- diff --git a/lib/pleroma/web/activity_pub/relay.ex b/lib/pleroma/web/activity_pub/relay.ex index f5cf8b7f5..d30853d62 100644 --- a/lib/pleroma/web/activity_pub/relay.ex +++ b/lib/pleroma/web/activity_pub/relay.ex @@ -1,5 +1,5 @@ defmodule Pleroma.Web.ActivityPub.Relay do - alias Pleroma.{User, Object} + alias Pleroma.{User, Object, Activity} alias Pleroma.Web.ActivityPub.ActivityPub require Logger @@ -31,7 +31,7 @@ defmodule Pleroma.Web.ActivityPub.Relay do :ok end - def publish(activity) do + def publish(%Activity{data: %{"type" => "Create"}} = activity) do with %User{} = user <- get_actor(), %Object{} = object <- Object.normalize(activity.data["object"]["id"]) do ActivityPub.announce(user, object) @@ -39,4 +39,6 @@ defmodule Pleroma.Web.ActivityPub.Relay do e -> Logger.error("error: #{inspect(e)}") end end + + def publish(_), do: nil end