X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fpoco.php;h=624a48d9ff1768b4654e59a63d44b20076f8a7b3;hb=07fff2c3f543f443cb391ba998f4f7cb2f0c2644;hp=6efd4ab8cc395116d763b09a3bae99ca4ae98716;hpb=978717a2475bbd25d61969e9448dc6f197c8d637;p=friendica.git diff --git a/mod/poco.php b/mod/poco.php index 6efd4ab8cc..624a48d9ff 100644 --- a/mod/poco.php +++ b/mod/poco.php @@ -45,6 +45,8 @@ function poco_init(&$a) { if($justme) $sql_extra = " and `contact`.`self` = 1 "; + else + $sql_extra = " and `contact`.`self` = 0 "; if($cid) $sql_extra = sprintf(" and `contact`.`id` = %d ",intval($cid)); @@ -54,7 +56,7 @@ function poco_init(&$a) { and uid in (select uid from pconfig where cat = 'system' and k = 'suggestme' and v = 1) "); } else { - $r = q("SELECT count(*) as `total` from `contact` where `uid` = %d and blocked = 0 and pending = 0 and hidden = 0 + $r = q("SELECT count(*) as `total` from `contact` where `uid` = %d and blocked = 0 and pending = 0 and hidden = 0 and archive = 0 $sql_extra ", intval($user['uid']) ); @@ -79,7 +81,7 @@ function poco_init(&$a) { } else { - $r = q("SELECT * from `contact` where `uid` = %d and blocked = 0 and pending = 0 and hidden = 0 + $r = q("SELECT * from `contact` where `uid` = %d and blocked = 0 and pending = 0 and hidden = 0 and archive = 0 $sql_extra LIMIT %d, %d", intval($user['uid']), intval($startIndex), @@ -127,8 +129,9 @@ function poco_init(&$a) { $entry['displayName'] = $rr['name']; if($fields_ret['urls']) { $entry['urls'] = array(array('value' => $rr['url'], 'type' => 'profile')); - if($rr['addr'] && ($rr['network'] !== NETWORK_MAIL) + if($rr['addr'] && ($rr['network'] !== NETWORK_MAIL)) $entry['urls'][] = array('value' => 'acct:' . $rr['addr'], 'type' => 'webfinger'); + } if($fields_ret['preferredUsername']) $entry['preferredUsername'] = $rr['nick']; if($fields_ret['photos']) @@ -145,7 +148,7 @@ function poco_init(&$a) { if($format === 'xml') { header('Content-type: text/xml'); echo replace_macros(get_markup_template('poco_xml.tpl'),array_xmlify(array('$response' => $ret))); - http_status_exit(500); + killme(); } if($format === 'json') { header('Content-type: application/json'); @@ -156,4 +159,4 @@ function poco_init(&$a) { http_status_exit(500); -} \ No newline at end of file +}