From c7cc80a9ee00f7bf9e307a09c5f2cc85fedd67d5 Mon Sep 17 00:00:00 2001 From: Sadposter Date: Thu, 28 Nov 2019 10:40:50 +0000 Subject: [PATCH] obligatory format commit --- lib/pleroma/user.ex | 3 ++- test/user_test.exs | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index 6a97e1928..63c5b4102 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -1020,7 +1020,8 @@ def muted_notifications?(user, %{ap_id: ap_id}), do: Enum.member?(user.muted_notifications, ap_id) def blocks?(%User{} = user, %User{} = target) do - blocks_ap_id?(user, target) || (!User.following?(user, target) && blocks_domain?(user, target)) + blocks_ap_id?(user, target) || + (!User.following?(user, target) && blocks_domain?(user, target)) end def blocks?(nil, _), do: false diff --git a/test/user_test.exs b/test/user_test.exs index 6a3820455..6ae563258 100644 --- a/test/user_test.exs +++ b/test/user_test.exs @@ -881,13 +881,13 @@ test "unblocks domains" do end test "follows take precedence over domain blocks" do - user = insert(:user) - good_eggo = insert(:user, %{ap_id: "https://meanies.social/user/cuteposter"}) - - {:ok, user} = User.block_domain(user, "meanies.social") - {:ok, user} = User.follow(user, good_eggo) + user = insert(:user) + good_eggo = insert(:user, %{ap_id: "https://meanies.social/user/cuteposter"}) - refute User.blocks?(user, good_eggo) + {:ok, user} = User.block_domain(user, "meanies.social") + {:ok, user} = User.follow(user, good_eggo) + + refute User.blocks?(user, good_eggo) end end