From fd28ecaaccbc2e51859411b7306d05da155bde47 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 29 Nov 2016 06:40:35 +0000 Subject: [PATCH] Pending contacts shouldn't be displayed in the sidebar --- include/identity.php | 2 +- include/text.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/identity.php b/include/identity.php index 133a12a13f..288f93aaf9 100644 --- a/include/identity.php +++ b/include/identity.php @@ -371,7 +371,7 @@ function profile_sidebar($profile, $block = 0) { if(count($r)) $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', '')", intval($profile['uid']), dbesc(NETWORK_DFRN), diff --git a/include/text.php b/include/text.php index 154e4e235f..b57016456a 100644 --- a/include/text.php +++ b/include/text.php @@ -12,7 +12,7 @@ if(! function_exists('replace_macros')) { * This is our template processor * * @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) * @return string substituted string */ @@ -874,7 +874,7 @@ function contact_block() { if((! is_array($a->profile)) || ($a->profile['hide-friends'])) return $o; $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 `network` IN ('%s', '%s', '%s')", intval($a->profile['uid']), @@ -892,7 +892,7 @@ function contact_block() { } else { // Splitting the query in two parts makes it much faster $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 `network` IN ('%s', '%s', '%s') ORDER BY RAND() LIMIT %d", intval($a->profile['uid']), -- 2.39.5