forked from YokaiRick/akkoma
activitypub transmogrifier: handle hubzilla AP actor quirks
This commit is contained in:
parent
4d2c6707c2
commit
2051530868
2 changed files with 15 additions and 0 deletions
|
@ -401,6 +401,8 @@ def user_data_from_user_object(data) do
|
|||
"url" => [%{"href" => data["image"]["url"]}]
|
||||
}
|
||||
|
||||
data = Transmogrifier.maybe_fix_user_object(data)
|
||||
|
||||
user_data = %{
|
||||
ap_id: data["id"],
|
||||
info: %{
|
||||
|
|
|
@ -495,4 +495,17 @@ def maybe_retire_websub(ap_id) 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