Salmon: generate private key with native crypto if available.
[akkoma] / lib / pleroma / user.ex
index 59d4fb839f4254eba5c039187871555b547e5d12..68ffe184b7b36fa031ecdbca12259fd88ec5609e 100644 (file)
@@ -265,6 +265,7 @@ defmodule Pleroma.User do
   def update_follower_count(%User{} = user) do
     follower_count_query = from u in User,
       where: fragment("? @> ?", u.following, ^user.follower_address),
+      where: u.id != ^user.id,
       select: count(u.id)
 
     follower_count = Repo.one(follower_count_query)
@@ -286,12 +287,12 @@ defmodule Pleroma.User 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