From 735cdfb8481af7ff78a0637fe5045d3f10961141 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Sat, 22 Sep 2018 01:37:05 +0000 Subject: [PATCH] user: add User.html_filter_policy() --- lib/pleroma/user.ex | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index e3e6aa0d8..487bfce32 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -669,6 +669,12 @@ defmodule Pleroma.User do :ok end + def html_filter_policy(%User{info: %{"no_rich_text" => true}}) do + Pleroma.HTML.Scrubber.TwitterText + end + + def html_filter_policy(_), do: nil + def get_or_fetch_by_ap_id(ap_id) do user = get_by_ap_id(ap_id) -- 2.45.2