From 2aee62a4565d36983484ead9dda187e9e8188971 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Sun, 12 May 2019 04:17:17 +0000 Subject: [PATCH] federator: publisher: only attempt publishing if we know the activity is representable --- lib/pleroma/web/federator/publisher.ex | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/pleroma/web/federator/publisher.ex b/lib/pleroma/web/federator/publisher.ex index 8777a3deb..67f4b7ba7 100644 --- a/lib/pleroma/web/federator/publisher.ex +++ b/lib/pleroma/web/federator/publisher.ex @@ -39,7 +39,7 @@ defmodule Pleroma.Web.Federator.Publisher do {:ok, _} -> :ok - {:error, _} -> + {:error, _e} -> RetryQueue.enqueue(params, module) end end @@ -58,8 +58,10 @@ defmodule Pleroma.Web.Federator.Publisher do def publish(%User{} = user, %Activity{} = activity) do Config.get([:instance, :federation_publisher_modules]) |> Enum.each(fn module -> - Logger.info("Publishing #{activity.data["id"]} using #{inspect(module)}") - module.publish(user, activity) + if module.is_representable?(activity) do + Logger.info("Publishing #{activity.data["id"]} using #{inspect(module)}") + module.publish(user, activity) + end end) :ok -- 2.45.2