diff options
author | Rin Toshaka <rinpatch@sdf.org> | 2018-12-29 21:50:34 +0100 |
---|---|---|
committer | Rin Toshaka <rinpatch@sdf.org> | 2018-12-29 21:50:34 +0100 |
commit | 9a0163db53580182599a9358bd0197ee0c61779d (patch) | |
tree | a292109cd74359d36da3ea04791c9ad3bc4d6d44 | |
parent | 19f9889fbe9d120acfaed2a5aedb4032d56eb217 (diff) | |
download | pleroma-9a0163db53580182599a9358bd0197ee0c61779d.tar.gz |
use Kernel.put_in instead of Map.merge
-rw-r--r-- | lib/pleroma/web/common_api/utils.ex | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/pleroma/web/common_api/utils.ex b/lib/pleroma/web/common_api/utils.ex index 5c37fd671..7b11bc3ed 100644 --- a/lib/pleroma/web/common_api/utils.ex +++ b/lib/pleroma/web/common_api/utils.ex @@ -300,17 +300,19 @@ defmodule Pleroma.Web.CommonAPI.Utils do if !(new_scrubber_cache == scrubber_cache) or scrubbed_html == nil do scrubbed_html = HTML.filter_tags(content, scrubbers) new_scrubber_cache = [%{:scrubbers => key, :content => scrubbed_html} | new_scrubber_cache] + IO.puts(activity) activity = - Map.merge(activity, %{ - data: %{"object" => %{"scrubber_cache" => new_scrubber_cache}} - }) + Map.put( + activity, + :data, + Kernel.put_in(activity.data, ["object", "scrubber_cache"], new_scrubber_cache) + ) cng = Ecto.Changeset.change(activity) Repo.update(cng) scrubbed_html else - IO.puts("got the post from cache") scrubbed_html end end |