Merge remote-tracking branch 'remotes/upstream/develop' into 1149-oban-job-queue
authorIvan Tashkinov <ivantashkinov@gmail.com>
Fri, 9 Aug 2019 17:09:56 +0000 (20:09 +0300)
committerIvan Tashkinov <ivantashkinov@gmail.com>
Fri, 9 Aug 2019 17:09:56 +0000 (20:09 +0300)
1  2 
config/config.exs
config/test.exs
docs/config.md
lib/pleroma/application.ex
lib/pleroma/web/activity_pub/utils.ex
mix.exs
mix.lock
test/user_test.exs
test/web/activity_pub/activity_pub_controller_test.exs
test/web/federator_test.exs

Simple merge
diff --cc config/test.exs
Simple merge
diff --cc docs/config.md
Simple merge
Simple merge
Simple merge
diff --cc mix.exs
Simple merge
diff --cc mix.lock
Simple merge
Simple merge
index ebe962da2958834134658fc4d1128b65e727f647,73cfaa8f1ec96dbb681ba44ccd4427dfd1a139ed..d3a28d50e72e129165b2d04d2b0d71f72947ba5e
@@@ -235,8 -227,23 +235,24 @@@ defmodule Pleroma.Web.FederatorTest d
          "to" => ["https://www.w3.org/ns/activitystreams#Public"]
        }
  
 -      :error = Federator.incoming_ap_doc(params)
 +      assert {:ok, job} = Federator.incoming_ap_doc(params)
 +      assert :error = ObanHelpers.perform(job)
      end
+     test "it does not crash if MRF rejects the post" do
+       policies = Pleroma.Config.get([:instance, :rewrite_policy])
+       mrf_keyword_policy = Pleroma.Config.get(:mrf_keyword)
+       Pleroma.Config.put([:mrf_keyword, :reject], ["lain"])
+       Pleroma.Config.put([:instance, :rewrite_policy], Pleroma.Web.ActivityPub.MRF.KeywordPolicy)
+       params =
+         File.read!("test/fixtures/mastodon-post-activity.json")
+         |> Poison.decode!()
+       assert Federator.incoming_ap_doc(params) == :error
+       Pleroma.Config.put([:instance, :rewrite_policy], policies)
+       Pleroma.Config.put(:mrf_keyword, mrf_keyword_policy)
+     end
    end
  end