alias Pleroma.Web.ActivityPub.Relay
alias Pleroma.Web.ActivityPub.Transmogrifier
alias Pleroma.Web.ActivityPub.Utils
+ alias Pleroma.Web.OStatus
require Logger
@websub Application.get_env(:pleroma, :websub)
{:ok, actor} = WebFinger.ensure_keys_present(actor)
if ActivityPub.is_public?(activity) do
- Logger.info(fn -> "Sending #{activity.data["id"]} out via WebSub" end)
- Websub.publish(Pleroma.Web.OStatus.feed_path(actor), actor, activity)
+ if OStatus.is_representable?(activity) do
+ Logger.info(fn -> "Sending #{activity.data["id"]} out via WebSub" end)
+ Websub.publish(Pleroma.Web.OStatus.feed_path(actor), actor, activity)
- Logger.info(fn -> "Sending #{activity.data["id"]} out via Salmon" end)
- Pleroma.Web.Salmon.publish(actor, activity)
+ Logger.info(fn -> "Sending #{activity.data["id"]} out via Salmon" end)
+ Pleroma.Web.Salmon.publish(actor, activity)
+ end
if Keyword.get(Application.get_env(:pleroma, :instance), :allow_relay) do
Logger.info(fn -> "Relaying #{activity.data["id"]} out" end)
alias Pleroma.Web.OStatus.{FollowHandler, UnfollowHandler, NoteHandler, DeleteHandler}
alias Pleroma.Web.ActivityPub.Transmogrifier
+ def is_representable?(%Activity{data: data}) do
+ object = Object.normalize(data["object"])
+
+ cond do
+ is_nil(object) ->
+ false
+
+ object.data["type"] == "Note" ->
+ true
+
+ true ->
+ false
+ end
+ end
+
def feed_path(user) do
"#{user.ap_id}/feed.atom"
end