From: Diogo Cordeiro Date: Fri, 26 Apr 2019 00:10:50 +0000 (+0100) Subject: Fix negative one subscriptions by XRevan86 X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=339204f1eed08e6a53fd098ad173d8e24f9602e0;p=quix0rs-gnu-social.git Fix negative one subscriptions by XRevan86 Only local users are subscribed to themselves. --- 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);