use Subscription::cancel() to cancel all subscriptions on block
This commit is contained in:
parent
c1c7feedbd
commit
d3f995846b
@ -525,8 +525,8 @@ class User extends Memcached_DataObject
|
|||||||
common_log(LOG_WARNING,
|
common_log(LOG_WARNING,
|
||||||
sprintf(
|
sprintf(
|
||||||
"Profile ID %d (%s) tried to block his or herself.",
|
"Profile ID %d (%s) tried to block his or herself.",
|
||||||
$profile->id,
|
$this->id,
|
||||||
$profile->nickname
|
$this->nickname
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
@ -548,13 +548,7 @@ class User extends Memcached_DataObject
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cancel their subscription, if it exists
|
Subscription::cancel($other, $this->getProfile());
|
||||||
|
|
||||||
$otherUser = User::staticGet('id', $other->id);
|
|
||||||
|
|
||||||
if (!empty($otherUser)) {
|
|
||||||
subs_unsubscribe_to($otherUser, $this->getProfile());
|
|
||||||
}
|
|
||||||
|
|
||||||
$block->query('COMMIT');
|
$block->query('COMMIT');
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user