]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Fix negative one subscriptions by XRevan86
authorDiogo Cordeiro <diogo@fc.up.pt>
Fri, 26 Apr 2019 00:10:50 +0000 (01:10 +0100)
committerDiogo Cordeiro <diogo@fc.up.pt>
Fri, 26 Apr 2019 00:10:53 +0000 (01:10 +0100)
Only local users are subscribed to themselves.

classes/Profile.php

index c2cc9b26e275d0b9d70cc1780f17e7238c6ef56c..8805244a9840c40c9f3dafd2f96edf2bd9e4b019 100644 (file)
@@ -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);