From 359bfb76f66efd585b0cba1b2f81494859931d61 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sun, 5 Nov 2017 16:29:01 -0800 Subject: common connections on suggestion page showing wildly different results than remote profile, and is consistently off by one --- Zotlabs/Module/Directory.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Zotlabs/Module/Directory.php') diff --git a/Zotlabs/Module/Directory.php b/Zotlabs/Module/Directory.php index caf0190ae..256667ef3 100644 --- a/Zotlabs/Module/Directory.php +++ b/Zotlabs/Module/Directory.php @@ -102,7 +102,7 @@ class Directory extends \Zotlabs\Web\Controller { $common = array(); $index = 0; foreach($r as $rr) { - $common[$rr['xchan_addr']] = $rr['total']; + $common[$rr['xchan_addr']] = ((intval($rr['total']) > 0) ? intval($rr['total']) - 1 : 0); $addresses[$rr['xchan_addr']] = $index++; } @@ -334,7 +334,7 @@ class Directory extends \Zotlabs\Web\Controller { 'ignlink' => $suggest ? z_root() . '/directory?ignore=' . $rr['hash'] : '', 'ignore_label' => t('Don\'t suggest'), 'common_friends' => (($common[$rr['address']]) ? intval($common[$rr['address']]) : ''), - 'common_label' => t('Common connections:'), + 'common_label' => t('Common connections (estimated):'), 'common_count' => intval($common[$rr['address']]), 'safe' => $safe_mode ); -- cgit v1.2.3