X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=classes%2FSubscription.php;h=c532a3c3de67474b0ca7a638b4cdac939527bcd3;hb=b374e5f08b0a5b0321ddd0ac77baf4675274aba2;hp=f77472ae7050447d203c0767944d68fd123786f5;hpb=174586bd512b757034e1b00dc9413309f59e9d72;p=quix0rs-gnu-social.git diff --git a/classes/Subscription.php b/classes/Subscription.php index f77472ae70..c532a3c3de 100644 --- a/classes/Subscription.php +++ b/classes/Subscription.php @@ -92,8 +92,8 @@ class Subscription extends Managed_DataObject } if (Event::handle('StartSubscribe', array($subscriber, $other))) { - $otherUser = User::getKV('id', $other->id); - if ($otherUser instanceof User && $otherUser->subscribe_policy == User::SUBSCRIBE_POLICY_MODERATE && !$force) { + // unless subscription is forced, the user policy for subscription approvals is tested + if (!$force && $other->requiresSubscriptionApproval($subscriber)) { try { $sub = Subscription_queue::saveNew($subscriber, $other); $sub->notify(); @@ -101,6 +101,7 @@ class Subscription extends Managed_DataObject $sub = Subscription_queue::getSubQueue($subscriber, $other); } } else { + $otherUser = User::getKV('id', $other->id); $sub = self::saveNew($subscriber, $other); $sub->notify();