From: hannes Date: Thu, 19 Nov 2015 15:55:11 +0000 (+0000) Subject: block check can't be done inside the same try-expression as Subscription::getSubscrip... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=abb8d1273ea66fb900594262b81011b111de3dea;p=quix0rs-gnu-social.git block check can't be done inside the same try-expression as Subscription::getSubscription(), since if that throws a NoResultException, the block check will not be done. and if you're blocking someone you are not subscribing to them. --- diff --git a/lib/apiaction.php b/lib/apiaction.php index 3564709e5b..25a51c4c5a 100644 --- a/lib/apiaction.php +++ b/lib/apiaction.php @@ -274,11 +274,11 @@ class ApiAction extends Action $sub = Subscription::getSubscription($this->scoped, $profile); // Notifications on? $twitter_user['following'] = true; - $twitter_user['statusnet_blocking'] = $this->scoped->hasBlocked($profile); $twitter_user['notifications'] = ($sub->jabber || $sub->sms); } catch (NoResultException $e) { // well, the values are already false... } + $twitter_user['statusnet_blocking'] = $this->scoped->hasBlocked($profile); } if ($get_notice) { @@ -1550,4 +1550,4 @@ class ApiAction extends Action return $uri; } -} +} \ No newline at end of file