mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-17 22:54:40 +00:00
federator: publisher: only attempt publishing if we know the activity is representable
This commit is contained in:
parent
69158f1065
commit
2aee62a456
1 changed files with 5 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue