Do not include user in their own follower count.
authoreal <eal@waifu.club>
Tue, 21 Nov 2017 13:33:09 +0000 (15:33 +0200)
committereal <eal@waifu.club>
Tue, 21 Nov 2017 13:33:09 +0000 (15:33 +0200)
lib/pleroma/user.ex

index f80c0ae338f54f3ed4714f6d877bcb2846a7edfa..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)