From 5d96cf2eec15dc08af5c539be53b427c50ef89a9 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sat, 10 Apr 2010 11:36:23 -0400 Subject: catch UserNoProfileException and continue --- lib/deluserqueuehandler.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/deluserqueuehandler.php b/lib/deluserqueuehandler.php index 4a1233a5e..710303938 100644 --- a/lib/deluserqueuehandler.php +++ b/lib/deluserqueuehandler.php @@ -49,9 +49,13 @@ class DelUserQueueHandler extends QueueHandler return true; } - if (!$user->hasRole(Profile_role::DELETED)) { - common_log(LOG_INFO, "User {$user->nickname} is not pending deletion; aborting."); - return true; + try { + if (!$user->hasRole(Profile_role::DELETED)) { + common_log(LOG_INFO, "User {$user->nickname} is not pending deletion; aborting."); + return true; + } + } catch (UserNoProfileException $unp) { + common_log(LOG_INFO, "Deleting user {$user->nickname} with no profile... probably a good idea!"); } $notice = $this->getNextBatch($user); -- cgit v1.2.3-54-g00ecf From 71c828de89d4092579470c9f2ba821ae803cb557 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 10 Apr 2010 17:52:40 -0700 Subject: Allow blocking someone who's not currently subscribed to you (prevents seeing @-replies from them, or them subbing to you in future) --- classes/User.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/classes/User.php b/classes/User.php index 2c256301c..1928a3c62 100644 --- a/classes/User.php +++ b/classes/User.php @@ -548,7 +548,10 @@ class User extends Memcached_DataObject return false; } - Subscription::cancel($other, $this->getProfile()); + $self = $this->getProfile(); + if (Subscription::exists($other, $self)) { + Subscription::cancel($other, $self); + } $block->query('COMMIT'); -- cgit v1.2.3-54-g00ecf