projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Pagination: Don't be dos'd by random parameters.
[akkoma]
/
lib
/
pleroma
/
web
/
activity_pub
/
transmogrifier.ex
diff --git
a/lib/pleroma/web/activity_pub/transmogrifier.ex
b/lib/pleroma/web/activity_pub/transmogrifier.ex
index 5499f8a0895318f6105bea39137404687e23b655..99cdf91ab1bc663e6e5c29c9cb61ca0f024426c3 100644
(file)
--- a/
lib/pleroma/web/activity_pub/transmogrifier.ex
+++ b/
lib/pleroma/web/activity_pub/transmogrifier.ex
@@
-653,7
+653,9
@@
defmodule Pleroma.Web.ActivityPub.Transmogrifier do
@spec get_obj_helper(String.t(), Keyword.t()) :: {:ok, Object.t()} | nil
def get_obj_helper(id, options \\ []) do
@spec get_obj_helper(String.t(), Keyword.t()) :: {:ok, Object.t()} | nil
def get_obj_helper(id, options \\ []) do
- case Object.normalize(id, true, options) do
+ options = Keyword.put(options, :fetch, true)
+
+ case Object.normalize(id, options) do
%Object{} = object -> {:ok, object}
_ -> nil
end
%Object{} = object -> {:ok, object}
_ -> nil
end
@@
-672,7
+674,7
@@
defmodule Pleroma.Web.ActivityPub.Transmogrifier do
"actor" => attributed_to,
"object" => data
}) do
"actor" => attributed_to,
"object" => data
}) do
- {:ok, Object.normalize(activity)}
+ {:ok, Object.normalize(activity
, fetch: false
)}
else
_ -> get_obj_helper(object_id)
end
else
_ -> get_obj_helper(object_id)
end
@@
-763,7
+765,7
@@
defmodule Pleroma.Web.ActivityPub.Transmogrifier do
when activity_type in ["Create", "Listen"] do
object =
object_id
when activity_type in ["Create", "Listen"] do
object =
object_id
- |> Object.normalize()
+ |> Object.normalize(
fetch: false
)
|> Map.get(:data)
|> prepare_object
|> Map.get(:data)
|> prepare_object
@@
-779,7
+781,7
@@
defmodule Pleroma.Web.ActivityPub.Transmogrifier do
def prepare_outgoing(%{"type" => "Announce", "actor" => ap_id, "object" => object_id} = data) do
object =
object_id
def prepare_outgoing(%{"type" => "Announce", "actor" => ap_id, "object" => object_id} = data) do
object =
object_id
- |> Object.normalize()
+ |> Object.normalize(
fetch: false
)
data =
if Visibility.is_private?(object) && object.data["actor"] == ap_id do
data =
if Visibility.is_private?(object) && object.data["actor"] == ap_id do