From 339204f1eed08e6a53fd098ad173d8e24f9602e0 Mon Sep 17 00:00:00 2001 From: Diogo Cordeiro Date: Fri, 26 Apr 2019 01:10:50 +0100 Subject: [PATCH] Fix negative one subscriptions by XRevan86 Only local users are subscribed to themselves. --- classes/Profile.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/classes/Profile.php b/classes/Profile.php index c2cc9b26e2..8805244a98 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -738,7 +738,10 @@ class Profile extends Managed_DataObject $cnt = (int) $sub->count('distinct subscribed'); - $cnt = ($cnt > 0) ? $cnt - 1 : $cnt; + // Local users are subscribed to themselves + if ($this->isLocal()) { + $cnt = ($cnt > 0) ? $cnt - 1 : $cnt; + } if (!empty($c)) { $c->set(Cache::key('profile:subscription_count:'.$this->id), $cnt); -- 2.39.5