mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-10 02:05:12 +00:00
activitypub transmogrifier: handle hubzilla AP actor quirks
This commit is contained in:
parent
4d2c6707c2
commit
2051530868
|
@ -401,6 +401,8 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
|
|||
"url" => [%{"href" => data["image"]["url"]}]
|
||||
}
|
||||
|
||||
data = Transmogrifier.maybe_fix_user_object(data)
|
||||
|
||||
user_data = %{
|
||||
ap_id: data["id"],
|
||||
info: %{
|
||||
|
|
|
@ -495,4 +495,17 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
|
|||
Repo.delete_all(q)
|
||||
end
|
||||
end
|
||||
|
||||
def maybe_fix_user_url(data) do
|
||||
if is_map(data["url"]) do
|
||||
data = Map.put(data, "url", data["url"]["href"])
|
||||
end
|
||||
|
||||
data
|
||||
end
|
||||
|
||||
def maybe_fix_user_object(data) do
|
||||
data
|
||||
|> maybe_fix_user_url
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue