From: Evan Prodromou Date: Wed, 31 Mar 2010 19:20:16 +0000 (-0400) Subject: use Subscription::cancel() to cancel all subscriptions on block X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d3f995846b2a849bc53eb965eb2607d8d1d6dd34;p=quix0rs-gnu-social.git use Subscription::cancel() to cancel all subscriptions on block --- diff --git a/classes/User.php b/classes/User.php index 659ec9467b..2c256301c2 100644 --- a/classes/User.php +++ b/classes/User.php @@ -525,8 +525,8 @@ class User extends Memcached_DataObject common_log(LOG_WARNING, sprintf( "Profile ID %d (%s) tried to block his or herself.", - $profile->id, - $profile->nickname + $this->id, + $this->nickname ) ); return false; @@ -548,13 +548,7 @@ class User extends Memcached_DataObject return false; } - // Cancel their subscription, if it exists - - $otherUser = User::staticGet('id', $other->id); - - if (!empty($otherUser)) { - subs_unsubscribe_to($otherUser, $this->getProfile()); - } + Subscription::cancel($other, $this->getProfile()); $block->query('COMMIT');