use Subscription::cancel() to cancel all subscriptions on block

This commit is contained in:
Evan Prodromou 2010-03-31 15:20:16 -04:00
parent c1c7feedbd
commit d3f995846b
1 changed files with 3 additions and 9 deletions

View File

@ -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');