diff options
| author | Mint <mint@plagu.ee> | 2024-04-12 23:04:37 +0300 | 
|---|---|---|
| committer | b <> | 2024-10-03 20:00:36 +0300 | 
| commit | 48af6850fc2903d6f8c7cbf43b7db6b769c37a2a (patch) | |
| tree | 777f1e1c6286bc5db2f6f19a8c89015c27d6c48c /test | |
| parent | 55612cb8ee4908a2fbb200ff581bb07c7e43410a (diff) | |
| download | pleroma-48af6850fc2903d6f8c7cbf43b7db6b769c37a2a.tar.gz pleroma-48af6850fc2903d6f8c7cbf43b7db6b769c37a2a.zip  | |
RemoteReportPolicy: Fix third-party report detection
Diffstat (limited to 'test')
| -rw-r--r-- | test/pleroma/web/activity_pub/mrf/remote_report_policy_test.exs | 15 | 
1 files changed, 14 insertions, 1 deletions
diff --git a/test/pleroma/web/activity_pub/mrf/remote_report_policy_test.exs b/test/pleroma/web/activity_pub/mrf/remote_report_policy_test.exs index dd56a1e9b..8d2a6b4fa 100644 --- a/test/pleroma/web/activity_pub/mrf/remote_report_policy_test.exs +++ b/test/pleroma/web/activity_pub/mrf/remote_report_policy_test.exs @@ -46,7 +46,7 @@ defmodule Pleroma.Web.ActivityPub.MRF.RemoteReportPolicyTest do      assert {:ok, _} = RemoteReportPolicy.filter(activity)    end -  test "rejects report on third-party if `reject_third_party: true`" do +  test "rejects report on third party if `reject_third_party: true`" do      clear_config([:mrf_remote_report, :reject_third_party], true)      clear_config([:mrf_remote_report, :reject_empty_message], false) @@ -59,6 +59,19 @@ defmodule Pleroma.Web.ActivityPub.MRF.RemoteReportPolicyTest do      assert {:reject, _} = RemoteReportPolicy.filter(activity)    end +  test "preserves report on first party if `reject_third_party: true`" do +    clear_config([:mrf_remote_report, :reject_third_party], true) +    clear_config([:mrf_remote_report, :reject_empty_message], false) + +    activity = %{ +      "type" => "Flag", +      "actor" => "https://mastodon.social/users/Gargron", +      "object" => ["http://localhost:4001/actor"] +    } + +    assert {:ok, _} = RemoteReportPolicy.filter(activity) +  end +    test "preserves report on third party if `reject_third_party: false`" do      clear_config([:mrf_remote_report, :reject_third_party], false)      clear_config([:mrf_remote_report, :reject_empty_message], false)  | 
