diff options
author | Ivan Tashkinov <ivant.business@gmail.com> | 2019-06-29 20:04:50 +0300 |
---|---|---|
committer | Ivan Tashkinov <ivant.business@gmail.com> | 2019-06-29 20:04:50 +0300 |
commit | 5b7b1040b38d262b1815276f86036b50847851c7 (patch) | |
tree | dc082d9b0534ade4c4d790e07333e532b1cda9e4 /lib/pleroma/object | |
parent | 9b1e75bac8f6e042e7f70e4f29cc60fa96000323 (diff) | |
download | pleroma-5b7b1040b38d262b1815276f86036b50847851c7.tar.gz |
[#161] Limited replies depth on incoming federation in order to prevent memory leaks on recursive replies fetching.
Diffstat (limited to 'lib/pleroma/object')
-rw-r--r-- | lib/pleroma/object/fetcher.ex | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/pleroma/object/fetcher.ex b/lib/pleroma/object/fetcher.ex index c422490ac..fffbf2bbb 100644 --- a/lib/pleroma/object/fetcher.ex +++ b/lib/pleroma/object/fetcher.ex @@ -22,7 +22,7 @@ defmodule Pleroma.Object.Fetcher do # TODO: # This will create a Create activity, which we need internally at the moment. - def fetch_object_from_id(id) do + def fetch_object_from_id(id, options \\ []) do if object = Object.get_cached_by_ap_id(id) do {:ok, object} else @@ -38,7 +38,7 @@ defmodule Pleroma.Object.Fetcher do "object" => data }, :ok <- Containment.contain_origin(id, params), - {:ok, activity} <- Transmogrifier.handle_incoming(params), + {:ok, activity} <- Transmogrifier.handle_incoming(params, options), {:object, _data, %Object{} = object} <- {:object, data, Object.normalize(activity, false)} do {:ok, object} @@ -63,8 +63,8 @@ defmodule Pleroma.Object.Fetcher do end end - def fetch_object_from_id!(id) do - with {:ok, object} <- fetch_object_from_id(id) do + def fetch_object_from_id!(id, options \\ []) do + with {:ok, object} <- fetch_object_from_id(id, options) do object else _e -> |