Fix negative one subscriptions by XRevan86

Only local users are subscribed to themselves.
This commit is contained in:
Diogo Cordeiro 2019-04-26 01:10:50 +01:00
parent a4e679a118
commit 339204f1ee

View File

@ -738,7 +738,10 @@ class Profile extends Managed_DataObject
$cnt = (int) $sub->count('distinct subscribed'); $cnt = (int) $sub->count('distinct subscribed');
// Local users are subscribed to themselves
if ($this->isLocal()) {
$cnt = ($cnt > 0) ? $cnt - 1 : $cnt; $cnt = ($cnt > 0) ? $cnt - 1 : $cnt;
}
if (!empty($c)) { if (!empty($c)) {
$c->set(Cache::key('profile:subscription_count:'.$this->id), $cnt); $c->set(Cache::key('profile:subscription_count:'.$this->id), $cnt);