-
- if (!empty($otherUser) &&
- $otherUser->autosubscribe &&
- !self::exists($other, $subscriber) &&
- !$subscriber->hasBlocked($other)) {
-
- try {
- self::start($other, $subscriber);
- } catch (Exception $e) {
- common_log(LOG_ERR, "Exception during autosubscribe of {$other->nickname} to profile {$subscriber->id}: {$e->getMessage()}");
+ if ($otherUser && $otherUser->subscribe_policy == User::SUBSCRIBE_POLICY_MODERATE && !$force) {
+ $sub = Subscription_queue::saveNew($subscriber, $other);
+ $sub->notify();
+ } else {
+ $sub = self::saveNew($subscriber->id, $other->id);
+ $sub->notify();
+
+ self::blow('user:notices_with_friends:%d', $subscriber->id);
+
+ self::blow('subscription:by-subscriber:'.$subscriber->id);
+ self::blow('subscription:by-subscribed:'.$other->id);
+
+ $subscriber->blowSubscriptionCount();
+ $other->blowSubscriberCount();
+
+ if (!empty($otherUser) &&
+ $otherUser->autosubscribe &&
+ !self::exists($other, $subscriber) &&
+ !$subscriber->hasBlocked($other)) {
+
+ try {
+ self::start($other, $subscriber);
+ } catch (Exception $e) {
+ common_log(LOG_ERR, "Exception during autosubscribe of {$other->nickname} to profile {$subscriber->id}: {$e->getMessage()}");
+ }