From 51a398f27a6d76d417afb62d2ee43429cfeb6b03 Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Sat, 5 Sep 2020 02:34:01 +0000 Subject: [PATCH] [UI] Subtract self follow from total user follows --- src/Entity/GSActor.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Entity/GSActor.php b/src/Entity/GSActor.php index cc5e44e0f8..f1f254c373 100644 --- a/src/Entity/GSActor.php +++ b/src/Entity/GSActor.php @@ -1,6 +1,7 @@ . + // }}} namespace App\Entity; @@ -253,7 +255,7 @@ class GSActor extends Entity return Cache::get('followers-' . $this->id, function () { return DB::dql('select count(f) from App\Entity\Follow f where f.followed = :followed', - ['followed' => $this->id])[0][1]; + ['followed' => $this->id])[0][1] - 1; // Remove self follow }); } @@ -262,7 +264,7 @@ class GSActor extends Entity return Cache::get('followed-' . $this->id, function () { return DB::dql('select count(f) from App\Entity\Follow f where f.follower = :follower', - ['follower' => $this->id])[0][1]; + ['follower' => $this->id])[0][1] - 1; // Remove self follow }); }