From e9037ffc8d38d905c746a30128ab8ca930acbcd1 Mon Sep 17 00:00:00 2001 From: eal Date: Tue, 21 Nov 2017 15:33:09 +0200 Subject: [PATCH] Do not include user in their own follower count. --- lib/pleroma/user.ex | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index f80c0ae33..68ffe184b 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -265,6 +265,7 @@ def update_note_count(%User{} = 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)