featured_address valition in AddRemoveValidator

This commit is contained in:
Alexander Strizhakov 2021-03-03 15:41:05 +03:00
commit d1d2744ee3
No known key found for this signature in database
GPG key ID: 022896A53AEF1381
7 changed files with 55 additions and 13 deletions

View file

@ -557,7 +557,7 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
end
def handle_incoming(%{"type" => type} = data, _options) when type in ~w(Add Remove) do
with {:ok, user} <- ObjectValidator.fetch_actor(data),
with {:ok, %User{} = user} <- ObjectValidator.fetch_actor(data),
%Object{} <- Object.normalize(data["object"], fetch: true) do
# Mastodon sends pin/unpin objects without id, to, cc fields
data =
@ -566,7 +566,10 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
|> Map.put_new("to", [Pleroma.Constants.as_public()])
|> Map.put_new("cc", [user.follower_address])
case Pipeline.common_pipeline(data, local: false) do
case Pipeline.common_pipeline(data,
local: false,
featured_address: user.featured_address
) do
{:ok, activity, _meta} -> {:ok, activity}
error -> error
end