turn inlineQuotePolicy on by default
authorFloatingGhost <hannah@coffee-and-dreams.uk>
Mon, 5 Sep 2022 16:22:33 +0000 (17:22 +0100)
committerFloatingGhost <hannah@coffee-and-dreams.uk>
Mon, 5 Sep 2022 16:22:33 +0000 (17:22 +0100)
lib/pleroma/web/activity_pub/mrf.ex
test/pleroma/web/activity_pub/builder_test.exs
test/pleroma/web/activity_pub/mrf_test.exs

index 5606dac832ed3916a0252cdddb6a5450c268effc..20bce0d5fb5ccb4d4504718d49fe5a3c37fe02b5 100644 (file)
@@ -95,7 +95,11 @@ defmodule Pleroma.Web.ActivityPub.MRF do
   def get_policies do
     Pleroma.Config.get([:mrf, :policies], [])
     |> get_policies()
-    |> Enum.concat([Pleroma.Web.ActivityPub.MRF.HashtagPolicy])
+    |> Enum.concat([
+      Pleroma.Web.ActivityPub.MRF.HashtagPolicy,
+      Pleroma.Web.ActivityPub.MRF.InlineQuotePolicy
+    ])
+    |> Enum.uniq()
   end
 
   defp get_policies(policy) when is_atom(policy), do: [policy]
index 98d20f02233c4219077821f72dd4d12e0b7decb5..9269733b738a8d2aa80aaba823708af253e48b6c 100644 (file)
@@ -82,23 +82,27 @@ defmodule Pleroma.Web.ActivityPub.BuilderTest do
     test "remote custom emoji" do
       user = insert(:user)
       other_user = insert(:user, local: false)
-      note = insert(:note, data: %{"reactions" => [["wow", [other_user.ap_id], "https://remote/emoji/wow"]]})
+
+      note =
+        insert(:note,
+          data: %{"reactions" => [["wow", [other_user.ap_id], "https://remote/emoji/wow"]]}
+        )
 
       assert {:ok,
-               %{
-                 "content" => ":wow:",
-                 "type" => "EmojiReact",
-                 "tag" => [
-                   %{
-                     "name" => ":wow:",
-                     "id" => "https://remote/emoji/wow",
-                     "icon" => %{
-                       "type" => "Image",
-                       "url" => "https://remote/emoji/wow"
-                     }
-                   }
-                 ]
-               }, []} = Builder.emoji_react(user, note, ":wow@remote:")
+              %{
+                "content" => ":wow:",
+                "type" => "EmojiReact",
+                "tag" => [
+                  %{
+                    "name" => ":wow:",
+                    "id" => "https://remote/emoji/wow",
+                    "icon" => %{
+                      "type" => "Image",
+                      "url" => "https://remote/emoji/wow"
+                    }
+                  }
+                ]
+              }, []} = Builder.emoji_react(user, note, ":wow@remote:")
     end
   end
 end
index 6ab27bc8676f91d9c4bc234fbae7c1240e99776f..ed3233758b54160a8edc918ec2952de356523641 100644 (file)
@@ -77,7 +77,7 @@ defmodule Pleroma.Web.ActivityPub.MRFTest do
       clear_config([:mrf, :policies], [Pleroma.Web.ActivityPub.MRF.NoOpPolicy])
 
       expected = %{
-        mrf_policies: ["NoOpPolicy", "HashtagPolicy"],
+        mrf_policies: ["NoOpPolicy", "HashtagPolicy", "InlineQuotePolicy"],
         mrf_hashtag: %{
           federated_timeline_removal: [],
           reject: [],
@@ -93,7 +93,7 @@ defmodule Pleroma.Web.ActivityPub.MRFTest do
       clear_config([:mrf, :policies], [MRFModuleMock])
 
       expected = %{
-        mrf_policies: ["MRFModuleMock", "HashtagPolicy"],
+        mrf_policies: ["MRFModuleMock", "HashtagPolicy", "InlineQuotePolicy"],
         mrf_module_mock: "some config data",
         mrf_hashtag: %{
           federated_timeline_removal: [],