diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex
index 59d4fb839..f80c0ae33 100644
--- a/lib/pleroma/user.ex
+++ b/lib/pleroma/user.ex
@@ -286,12 +286,12 @@ def get_notified_from_activity(%Activity{data: %{"to" => to}}) do
 
   def get_recipients_from_activity(%Activity{data: %{"to" => to}}) do
     query = from u in User,
-      where: u.local == true
-
-    query = from u in query,
       where: u.ap_id in ^to,
       or_where: fragment("? \\\?| ?", u.following, ^to)
 
+    query = from u in query,
+      where: u.local == true
+
     Repo.all(query)
   end
 
diff --git a/test/user_test.exs b/test/user_test.exs
index c06663ed7..8ec23c751 100644
--- a/test/user_test.exs
+++ b/test/user_test.exs
@@ -318,6 +318,7 @@ test "get recipients from activity" do
     assert [addressed] == User.get_recipients_from_activity(activity)
 
     {:ok, user} = User.follow(user, actor)
+    {:ok, user_two} = User.follow(user_two, actor)
     recipients = User.get_recipients_from_activity(activity)
     assert length(recipients) == 2
     assert user in recipients