Fix user fetch completely broken if featured collection is not in a supported form
This commit is contained in:
parent
48e490cd58
commit
a1621839cc
@ -0,0 +1 @@
|
|||||||
|
Fix user fetch completely broken if featured collection is not in a supported form
|
@ -1720,6 +1720,11 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def pin_data_from_featured_collection(obj) do
|
||||||
|
Logger.error("Could not parse featured collection #{inspect(obj)}")
|
||||||
|
%{}
|
||||||
|
end
|
||||||
|
|
||||||
def fetch_and_prepare_featured_from_ap_id(nil) do
|
def fetch_and_prepare_featured_from_ap_id(nil) do
|
||||||
{:ok, %{}}
|
{:ok, %{}}
|
||||||
end
|
end
|
||||||
|
@ -2652,4 +2652,12 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
|
|||||||
{:ok, user} = ActivityPub.make_user_from_ap_id("https://princess.cat/users/mewmew")
|
{:ok, user} = ActivityPub.make_user_from_ap_id("https://princess.cat/users/mewmew")
|
||||||
assert user.name == " "
|
assert user.name == " "
|
||||||
end
|
end
|
||||||
|
|
||||||
|
test "pin_data_from_featured_collection will ignore unsupported values" do
|
||||||
|
assert %{} ==
|
||||||
|
ActivityPub.pin_data_from_featured_collection(%{
|
||||||
|
"type" => "OrderedCollection",
|
||||||
|
"first" => "https://social.example/users/alice/collections/featured?page=true"
|
||||||
|
})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user