From 2fec0c5cd1b11828f808f5a63b89e093cfc3aa1c Mon Sep 17 00:00:00 2001 From: Hannes Mannerheim Date: Sun, 24 Jan 2016 13:59:07 +0100 Subject: [PATCH] fixes https://git.gnu.io/h2p/Qvitter/issues/4 --- actions/apiexternalusershow.php | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/actions/apiexternalusershow.php b/actions/apiexternalusershow.php index 81fc790..9eed117 100644 --- a/actions/apiexternalusershow.php +++ b/actions/apiexternalusershow.php @@ -119,24 +119,6 @@ class ApiExternalUserShowAction extends ApiPrivateAuthAction return true; } - // if we don't know about this user, or the user has changed nickname - // if profile url ends with '/' this is probably an unknown single user instance - if(substr($profileurl, -1)==='/') { - $instanceurl = $profileurl; - $user_id_or_nickname = 1; - } - - // multi user instance - else { - $user_id_or_nickname = substr($profileurl, strrpos($profileurl, '/')+1); - $instanceurl = substr($profileurl, 0, strrpos($profileurl, '/')); - } - $external_profile = $this->getProfileFromExternalInstance($instanceurl,$user_id_or_nickname); - if(!isset($external_profile->statusnet_profile_url)) { - return true; - } - $this->profile->external = $external_profile; - return true; } @@ -154,9 +136,13 @@ class ApiExternalUserShowAction extends ApiPrivateAuthAction { parent::handle(); - $this->initDocument('json'); - $this->showJsonObjects($this->profile); - $this->endDocument('json'); + if(is_null($this->profile->local) && is_null($this->profile->external)) { + $this->clientError(_('List not found.'), 404); + } else { + $this->initDocument('json'); + $this->showJsonObjects($this->profile); + $this->endDocument('json'); + } } /**