defmodule Pleroma.Web.ActivityPub.Relay do
- alias Pleroma.User
+ alias Pleroma.{User, Object}
alias Pleroma.Web.ActivityPub.ActivityPub
require Logger
:ok
end
+
+ def publish(activity) do
+ with %User{} = user <- get_actor(),
+ %Object{} = object <- Object.normalize(activity.data["object"]["id"]) do
+ ActivityPub.announce(user, object)
+ else
+ e -> Logger.error("error: #{inspect(e)}")
+ end
+ end
end
alias Pleroma.Activity
alias Pleroma.Web.{WebFinger, Websub}
alias Pleroma.Web.ActivityPub.ActivityPub
+ alias Pleroma.Web.ActivityPub.Relay
alias Pleroma.Web.ActivityPub.Transmogrifier
alias Pleroma.Web.ActivityPub.Utils
require Logger
Logger.info(fn -> "Sending #{activity.data["id"]} out via Salmon" end)
Pleroma.Web.Salmon.publish(actor, activity)
+
+ Logger.info(fn -> "Relaying #{activity.data["id"]} out" end)
+ Pleroma.Web.ActivityPub.Relay.publish(activity)
end
Logger.info(fn -> "Sending #{activity.data["id"]} out via AP" end)