user: add User.html_filter_policy()
authorWilliam Pitcock <nenolod@dereferenced.org>
Sat, 22 Sep 2018 01:37:05 +0000 (01:37 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Sat, 22 Sep 2018 02:53:00 +0000 (02:53 +0000)
lib/pleroma/user.ex

index e3e6aa0d807783e334203fba2ebc48c5c7ba650d..487bfce3264173a9d81bf57a43b4f25d45e059c8 100644 (file)
@@ -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)