forked from AkkomaGang/akkoma
ObjectValidator: Add actor fetcher.
This commit is contained in:
parent
64bb72f98a
commit
42ce7c5164
1 changed files with 7 additions and 1 deletions
|
@ -46,8 +46,14 @@ def stringify_keys(object) do
|
|||
|> Map.new(fn {key, val} -> {to_string(key), val} end)
|
||||
end
|
||||
|
||||
def fetch_actor(object) do
|
||||
with {:ok, actor} <- Types.ObjectID.cast(object["actor"]) do
|
||||
User.get_or_fetch_by_ap_id(actor)
|
||||
end
|
||||
end
|
||||
|
||||
def fetch_actor_and_object(object) do
|
||||
User.get_or_fetch_by_ap_id(object["actor"])
|
||||
fetch_actor(object)
|
||||
Object.normalize(object["object"])
|
||||
:ok
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue