1
0
Fork 0

Pending contacts shouldn't be displayed in the sidebar

This commit is contained in:
Michael 2016-11-29 06:40:35 +00:00
parent 3a76a6766f
commit fd28ecaacc
2 changed files with 4 additions and 4 deletions

View file

@ -371,7 +371,7 @@ function profile_sidebar($profile, $block = 0) {
if(count($r)) if(count($r))
$updated = date("c", strtotime($r[0]['updated'])); $updated = date("c", strtotime($r[0]['updated']));
$r = q("SELECT COUNT(*) AS `total` FROM `contact` WHERE `uid` = %d AND NOT `self` AND (NOT `blocked` OR `pending`) AND NOT `hidden` AND NOT `archive` $r = q("SELECT COUNT(*) AS `total` FROM `contact` WHERE `uid` = %d AND NOT `self` AND NOT `blocked` AND NOT `hidden` AND NOT `archive`
AND `network` IN ('%s', '%s', '%s', '')", AND `network` IN ('%s', '%s', '%s', '')",
intval($profile['uid']), intval($profile['uid']),
dbesc(NETWORK_DFRN), dbesc(NETWORK_DFRN),

View file

@ -12,7 +12,7 @@ if(! function_exists('replace_macros')) {
* This is our template processor * This is our template processor
* *
* @param string|FriendicaSmarty $s the string requiring macro substitution, * @param string|FriendicaSmarty $s the string requiring macro substitution,
* or an instance of FriendicaSmarty * or an instance of FriendicaSmarty
* @param array $r key value pairs (search => replace) * @param array $r key value pairs (search => replace)
* @return string substituted string * @return string substituted string
*/ */
@ -874,7 +874,7 @@ function contact_block() {
if((! is_array($a->profile)) || ($a->profile['hide-friends'])) if((! is_array($a->profile)) || ($a->profile['hide-friends']))
return $o; return $o;
$r = q("SELECT COUNT(*) AS `total` FROM `contact` $r = q("SELECT COUNT(*) AS `total` FROM `contact`
WHERE `uid` = %d AND NOT `self` AND (NOT `blocked` OR `pending`) WHERE `uid` = %d AND NOT `self` AND NOT `blocked`
AND NOT `hidden` AND NOT `archive` AND NOT `hidden` AND NOT `archive`
AND `network` IN ('%s', '%s', '%s')", AND `network` IN ('%s', '%s', '%s')",
intval($a->profile['uid']), intval($a->profile['uid']),
@ -892,7 +892,7 @@ function contact_block() {
} else { } else {
// Splitting the query in two parts makes it much faster // Splitting the query in two parts makes it much faster
$r = q("SELECT `id` FROM `contact` $r = q("SELECT `id` FROM `contact`
WHERE `uid` = %d AND NOT `self` AND (NOT `blocked` OR `pending`) WHERE `uid` = %d AND NOT `self` AND NOT `blocked`
AND NOT `hidden` AND NOT `archive` AND NOT `hidden` AND NOT `archive`
AND `network` IN ('%s', '%s', '%s') ORDER BY RAND() LIMIT %d", AND `network` IN ('%s', '%s', '%s') ORDER BY RAND() LIMIT %d",
intval($a->profile['uid']), intval($a->profile['uid']),