Transmogrifier: Small readability changes.
This commit is contained in:
parent
54a6855ddf
commit
8f9fbc86c0
@ -661,7 +661,8 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
|
|||||||
)
|
)
|
||||||
when type in ~w{Update Block Follow} do
|
when type in ~w{Update Block Follow} do
|
||||||
with {:ok, %User{}} <- ObjectValidator.fetch_actor(data),
|
with {:ok, %User{}} <- ObjectValidator.fetch_actor(data),
|
||||||
{:ok, activity, _} <- Pipeline.common_pipeline(data, local: false) do
|
{:ok, activity, _} <-
|
||||||
|
Pipeline.common_pipeline(data, local: false) do
|
||||||
{:ok, activity}
|
{:ok, activity}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -670,7 +671,8 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
|
|||||||
%{"type" => "Delete"} = data,
|
%{"type" => "Delete"} = data,
|
||||||
_options
|
_options
|
||||||
) do
|
) do
|
||||||
with {:ok, activity, _} <- Pipeline.common_pipeline(data, local: false) do
|
with {:ok, activity, _} <-
|
||||||
|
Pipeline.common_pipeline(data, local: false) do
|
||||||
{:ok, activity}
|
{:ok, activity}
|
||||||
else
|
else
|
||||||
{:error, {:validate_object, _}} = e ->
|
{:error, {:validate_object, _}} = e ->
|
||||||
|
@ -130,7 +130,7 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.UndoHandlingTest do
|
|||||||
"http://mastodon.example.org/users/admin/statuses/99542391527669785/activity"
|
"http://mastodon.example.org/users/admin/statuses/99542391527669785/activity"
|
||||||
end
|
end
|
||||||
|
|
||||||
test "it works for incomming unfollows with an existing follow" do
|
test "it works for incoming unfollows with an existing follow" do
|
||||||
user = insert(:user)
|
user = insert(:user)
|
||||||
|
|
||||||
follow_data =
|
follow_data =
|
||||||
|
Loading…
Reference in New Issue
Block a user