]> git.mxchange.org Git - friendica.git/blobdiff - mod/poco.php
modified: view/theme/smoothly/theme.php
[friendica.git] / mod / poco.php
index 6331131fadf7d33a77af427eab4aea667cd21307..acfa3ffaa98e46c637fffdf4c96e5463b5a88cdb 100644 (file)
@@ -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
+               $r = q("SELECT count(*) as `total` from `contact` where `uid` = %d and blocked = 0 and pending = 0 and hidden = 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
+               $r = q("SELECT * from `contact` where `uid` = %d and blocked = 0 and pending = 0 and hidden = 0
                        $sql_extra LIMIT %d, %d",
                        intval($user['uid']),
                        intval($startIndex),
@@ -125,8 +127,11 @@ function poco_init(&$a) {
                                        $entry['id'] = $rr['id'];
                                if($fields_ret['displayName'])
                                        $entry['displayName'] = $rr['name'];
-                               if($fields_ret['urls'])
+                               if($fields_ret['urls']) {
                                        $entry['urls'] = array(array('value' => $rr['url'], 'type' => 'profile'));
+                                       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'])