obligatory format commit
authorSadposter <hannah+pleroma@coffee-and-dreams.uk>
Thu, 28 Nov 2019 10:40:50 +0000 (10:40 +0000)
committerSadposter <hannah+pleroma@coffee-and-dreams.uk>
Thu, 28 Nov 2019 10:40:50 +0000 (10:40 +0000)
lib/pleroma/user.ex
test/user_test.exs

index 6a97e19282fac375a21bd8c7f3d82e208ab9f724..63c5b4102dcffd2bad0a7e5d150f1d16aeb214f0 100644 (file)
@@ -1020,7 +1020,8 @@ defmodule Pleroma.User do
     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
index 6a38204558b3d8e58a2dcedce72c8b8fe0cbceb1..6ae563258b6e062dc7cf098509d880c02993168a 100644 (file)
@@ -881,13 +881,13 @@ defmodule Pleroma.UserTest 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"})
+
+      {:ok, user} = User.block_domain(user, "meanies.social")
+      {:ok, user} = User.follow(user, good_eggo)
 
-        refute User.blocks?(user, good_eggo)
+      refute User.blocks?(user, good_eggo)
     end
   end