X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fpleroma%2Fweb%2Ffederator.ex;h=f5ef76d32f0ae9a5324a325cc0fce8c91eeffb2d;hb=39f3683a06aea3d6aed85c611b0db0f6ea21052a;hp=13065414545829c8bf4696bbfff83246433ea551;hpb=c3112fd13a6af239b9dff0813e93266ec58f571e;p=akkoma
diff --git a/lib/pleroma/web/federator.ex b/lib/pleroma/web/federator.ex
index 130654145..f5ef76d32 100644
--- a/lib/pleroma/web/federator.ex
+++ b/lib/pleroma/web/federator.ex
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors
+# Copyright © 2017-2021 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.Federator do
@@ -15,6 +15,8 @@ defmodule Pleroma.Web.Federator do
require Logger
+ @behaviour Pleroma.Web.Federator.Publishing
+
@doc """
Returns `true` if the distance to target object does not exceed max configured value.
Serves to prevent fetching of very long threads, especially useful on smaller instances.
@@ -39,10 +41,12 @@ defmodule Pleroma.Web.Federator do
ReceiverWorker.enqueue("incoming_ap_doc", %{"params" => params})
end
+ @impl true
def publish(%{id: "pleroma:fakeid"} = activity) do
perform(:publish, activity)
end
+ @impl true
def publish(activity) do
PublisherWorker.enqueue("publish", %{"activity_id" => activity.id})
end