aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/html.ex
diff options
context:
space:
mode:
authorIvan Tashkinov <ivant.business@gmail.com>2019-04-08 12:20:26 +0300
committerIvan Tashkinov <ivant.business@gmail.com>2019-04-08 12:20:26 +0300
commitbffddf5e31c53d0603de387c61b6011f70785b97 (patch)
tree97f07fb95346b603307534a34d0ecee5c9b70af1 /lib/pleroma/html.ex
parente3328bc1382315c9067c099995a29db70d9d0433 (diff)
parentb177e1e7f330ff1531be190949db7f75e378a449 (diff)
downloadpleroma-bffddf5e31c53d0603de387c61b6011f70785b97.tar.gz
[#923] Merge remote-tracking branch 'remotes/upstream/develop' into twitter_oauth
# Conflicts: # docs/config.md # test/support/factory.ex
Diffstat (limited to 'lib/pleroma/html.ex')
-rw-r--r--lib/pleroma/html.ex15
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/pleroma/html.ex b/lib/pleroma/html.ex
index 1e48749a8..7f1dbe28c 100644
--- a/lib/pleroma/html.ex
+++ b/lib/pleroma/html.ex
@@ -28,21 +28,20 @@ defmodule Pleroma.HTML do
def filter_tags(html), do: filter_tags(html, nil)
def strip_tags(html), do: Scrubber.scrub(html, Scrubber.StripTags)
- # TODO: rename object to activity because that's what it is really working with
- def get_cached_scrubbed_html_for_object(content, scrubbers, object, module) do
- key = "#{module}#{generate_scrubber_signature(scrubbers)}|#{object.id}"
+ def get_cached_scrubbed_html_for_activity(content, scrubbers, activity, key \\ "") do
+ key = "#{key}#{generate_scrubber_signature(scrubbers)}|#{activity.id}"
Cachex.fetch!(:scrubber_cache, key, fn _key ->
- ensure_scrubbed_html(content, scrubbers, object.data["object"]["fake"] || false)
+ ensure_scrubbed_html(content, scrubbers, activity.data["object"]["fake"] || false)
end)
end
- def get_cached_stripped_html_for_object(content, object, module) do
- get_cached_scrubbed_html_for_object(
+ def get_cached_stripped_html_for_activity(content, activity, key) do
+ get_cached_scrubbed_html_for_activity(
content,
HtmlSanitizeEx.Scrubber.StripTags,
- object,
- module
+ activity,
+ key
)
end