projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
64bb72f
)
ObjectValidator: Add actor fetcher.
author
lain
<lain@soykaf.club>
Thu, 30 Apr 2020 12:13:08 +0000
(14:13 +0200)
committer
lain
<lain@soykaf.club>
Thu, 30 Apr 2020 12:13:08 +0000
(14:13 +0200)
lib/pleroma/web/activity_pub/object_validator.ex
patch
|
blob
|
history
diff --git
a/lib/pleroma/web/activity_pub/object_validator.ex
b/lib/pleroma/web/activity_pub/object_validator.ex
index f476c6f724a9eec5b8320794a6ef681f5df5b10e..016f6e7a2d253bf5fac5aec49b50774edca13f3e 100644
(file)
--- a/
lib/pleroma/web/activity_pub/object_validator.ex
+++ b/
lib/pleroma/web/activity_pub/object_validator.ex
@@
-46,8
+46,14
@@
defmodule Pleroma.Web.ActivityPub.ObjectValidator 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