ForceBotUnlistedPolicy: format
authorAlibek Omarov <a1ba.omarov@gmail.com>
Mon, 7 Sep 2020 20:53:45 +0000 (22:53 +0200)
committerGitea <gitea@fake.local>
Mon, 7 Sep 2020 20:53:45 +0000 (22:53 +0200)
lib/pleroma/web/activity_pub/mrf/force_bot_unlisted_policy.ex
test/web/activity_pub/mrf/force_bot_unlisted_policy_test.ex

index 31fd90586a9500bfc5bc36868a9259c92fefa42e..7290f444b2a17fad9806ed89ec793d6012fef276 100644 (file)
@@ -21,14 +21,14 @@ defmodule Pleroma.Web.ActivityPub.MRF.ForceBotUnlistedPolicy do
 
   @impl true
   def filter(
-         %{
-           "type" => "Create",
-           "to" => to,
-           "cc" => cc,
-           "actor" => actor,
-           "object" => object
-         } = message
-       ) do
+        %{
+          "type" => "Create",
+          "to" => to,
+          "cc" => cc,
+          "actor" => actor,
+          "object" => object
+        } = message
+      ) do
     user = User.get_cached_by_ap_id(actor)
     isbot = 0.8 < botness_score(user)
 
index 84e2a9024465d48dc5e0eb188750f8a607c2a44c..6f001c2330d5d3d3ddb94e62fe60bf8b2b5e1632 100644 (file)
@@ -10,18 +10,19 @@ defmodule Pleroma.Web.ActivityPub.MRF.ForceBotUnlistedPolicyTest do
 
   defp generate_messages(actor) do
     {%{
-      "actor" => actor.ap_id,
-      "type" => "Create",
-      "object" => %{},
-      "to" => [@public, "f"],
-      "cc" => [actor.follower_address, "d"]
-    }, %{
-      "actor" => actor.ap_id,
-      "type" => "Create",
-      "object" => %{"to" => ["f", actor.follower_address], "cc" => ["d", @public]},
-      "to" => ["f", actor.follower_address],
-      "cc" => ["d", @public]
-    }}
+       "actor" => actor.ap_id,
+       "type" => "Create",
+       "object" => %{},
+       "to" => [@public, "f"],
+       "cc" => [actor.follower_address, "d"]
+     },
+     %{
+       "actor" => actor.ap_id,
+       "type" => "Create",
+       "object" => %{"to" => ["f", actor.follower_address], "cc" => ["d", @public]},
+       "to" => ["f", actor.follower_address],
+       "cc" => ["d", @public]
+     }}
   end
 
   test "removes from the federated timeline by nickname heuristics 1" do