We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit abb8d127 authored by hannes's avatar hannes

block check can't be done inside the same try-expression as...

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. 
parent dbdac9cf
...@@ -274,11 +274,11 @@ class ApiAction extends Action ...@@ -274,11 +274,11 @@ class ApiAction extends Action
$sub = Subscription::getSubscription($this->scoped, $profile); $sub = Subscription::getSubscription($this->scoped, $profile);
// Notifications on? // Notifications on?
$twitter_user['following'] = true; $twitter_user['following'] = true;
$twitter_user['statusnet_blocking'] = $this->scoped->hasBlocked($profile);
$twitter_user['notifications'] = ($sub->jabber || $sub->sms); $twitter_user['notifications'] = ($sub->jabber || $sub->sms);
} catch (NoResultException $e) { } catch (NoResultException $e) {
// well, the values are already false... // well, the values are already false...
} }
$twitter_user['statusnet_blocking'] = $this->scoped->hasBlocked($profile);
} }
if ($get_notice) { if ($get_notice) {
...@@ -1550,4 +1550,4 @@ class ApiAction extends Action ...@@ -1550,4 +1550,4 @@ class ApiAction extends Action
return $uri; return $uri;
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment