Merge branch 'fix/scrubber-cache' into 'develop'
[#481] Store scrubbed posts in Cachex Closes #481 See merge request pleroma/pleroma!610
This commit is contained in:
commit
33e3a7ba7d
6 changed files with 70 additions and 9 deletions
|
|
@ -120,7 +120,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
|
|||
content =
|
||||
object
|
||||
|> render_content()
|
||||
|> HTML.filter_tags(User.html_filter_policy(opts[:for]))
|
||||
|> HTML.get_cached_scrubbed_html_for_object(User.html_filter_policy(opts[:for]), activity)
|
||||
|
||||
%{
|
||||
id: to_string(activity.id),
|
||||
|
|
|
|||
|
|
@ -11,11 +11,11 @@ defmodule Pleroma.Web.TwitterAPI.ActivityView do
|
|||
alias Pleroma.Web.TwitterAPI.TwitterAPI
|
||||
alias Pleroma.Web.TwitterAPI.Representers.ObjectRepresenter
|
||||
alias Pleroma.Activity
|
||||
alias Pleroma.HTML
|
||||
alias Pleroma.Object
|
||||
alias Pleroma.User
|
||||
alias Pleroma.Repo
|
||||
alias Pleroma.Formatter
|
||||
alias Pleroma.HTML
|
||||
|
||||
import Ecto.Query
|
||||
require Logger
|
||||
|
|
@ -245,14 +245,14 @@ defmodule Pleroma.Web.TwitterAPI.ActivityView do
|
|||
|
||||
html =
|
||||
content
|
||||
|> HTML.filter_tags(User.html_filter_policy(opts[:for]))
|
||||
|> HTML.get_cached_scrubbed_html_for_object(User.html_filter_policy(opts[:for]), activity)
|
||||
|> Formatter.emojify(object["emoji"])
|
||||
|
||||
text =
|
||||
if content do
|
||||
content
|
||||
|> String.replace(~r/<br\s?\/?>/, "\n")
|
||||
|> HTML.strip_tags()
|
||||
|> HTML.get_cached_stripped_html_for_object(activity)
|
||||
end
|
||||
|
||||
reply_parent = Activity.get_in_reply_to_activity(activity)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue