Revert Rich Media censorship for sensitive statuses
authorMark Felder <feld@FreeBSD.org>
Mon, 28 Sep 2020 23:22:59 +0000 (18:22 -0500)
committerMark Felder <feld@FreeBSD.org>
Mon, 28 Sep 2020 23:22:59 +0000 (18:22 -0500)
The #NSFW hashtag test was broken anyway.

lib/pleroma/web/rich_media/helpers.ex
test/web/rich_media/helpers_test.exs

index d7a19df4a125e8b565106a02395ebc2b54cd8098..d67b594b57dd10a2edce2bc9362e8ff1b7dcd219 100644 (file)
@@ -57,7 +57,6 @@ defmodule Pleroma.Web.RichMedia.Helpers do
 
   def fetch_data_for_object(object) do
     with true <- Config.get([:rich_media, :enabled]),
-         false <- object.data["sensitive"] || false,
          {:ok, page_url} <-
            HTML.extract_first_external_url_from_object(object),
          :ok <- validate_page_url(page_url),
index 8264a9c4166bfbb3c8f29f72120845c76122c20e..4b97bd66b6ffc32b9137ece09d2b7ad8642dfded 100644 (file)
@@ -64,41 +64,6 @@ defmodule Pleroma.Web.RichMedia.HelpersTest do
              Pleroma.Web.RichMedia.Helpers.fetch_data_for_activity(activity)
   end
 
-  test "refuses to crawl URLs from posts marked sensitive" do
-    user = insert(:user)
-
-    {:ok, activity} =
-      CommonAPI.post(user, %{
-        status: "http://example.com/ogp",
-        sensitive: true
-      })
-
-    %Object{} = object = Object.normalize(activity)
-
-    assert object.data["sensitive"]
-
-    Config.put([:rich_media, :enabled], true)
-
-    assert %{} = Pleroma.Web.RichMedia.Helpers.fetch_data_for_activity(activity)
-  end
-
-  test "refuses to crawl URLs from posts tagged NSFW" do
-    user = insert(:user)
-
-    {:ok, activity} =
-      CommonAPI.post(user, %{
-        status: "http://example.com/ogp #nsfw"
-      })
-
-    %Object{} = object = Object.normalize(activity)
-
-    assert object.data["sensitive"]
-
-    Config.put([:rich_media, :enabled], true)
-
-    assert %{} = Pleroma.Web.RichMedia.Helpers.fetch_data_for_activity(activity)
-  end
-
   test "refuses to crawl URLs of private network from posts" do
     user = insert(:user)