Merge branch 'fix/html-cache-content-collision' into 'develop'

Different caches based on the module. Remove scrubber version since it is not relevant anymore

See merge request pleroma/pleroma!628
This commit is contained in:
kaniini 2019-01-04 23:35:56 +00:00
commit bf5aaefbb5
3 changed files with 21 additions and 28 deletions

View file

@ -120,7 +120,11 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
content =
object
|> render_content()
|> HTML.get_cached_scrubbed_html_for_object(User.html_filter_policy(opts[:for]), activity)
|> HTML.get_cached_scrubbed_html_for_object(
User.html_filter_policy(opts[:for]),
activity,
__MODULE__
)
%{
id: to_string(activity.id),

View file

@ -245,14 +245,18 @@ defmodule Pleroma.Web.TwitterAPI.ActivityView do
html =
content
|> HTML.get_cached_scrubbed_html_for_object(User.html_filter_policy(opts[:for]), activity)
|> HTML.get_cached_scrubbed_html_for_object(
User.html_filter_policy(opts[:for]),
activity,
__MODULE__
)
|> Formatter.emojify(object["emoji"])
text =
if content do
content
|> String.replace(~r/<br\s?\/?>/, "\n")
|> HTML.get_cached_stripped_html_for_object(activity)
|> HTML.get_cached_stripped_html_for_object(activity, __MODULE__)
end
reply_parent = Activity.get_in_reply_to_activity(activity)