From 51848c619080e19cace647966a17eb9a1b42ca25 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 20 Jan 2015 19:33:19 -0800 Subject: working through the xchan table to remove bitfields, mostly complete except for updating the updater --- mod/viewconnections.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'mod/viewconnections.php') diff --git a/mod/viewconnections.php b/mod/viewconnections.php index 40d26c823..d4731d8c4 100644 --- a/mod/viewconnections.php +++ b/mod/viewconnections.php @@ -31,25 +31,24 @@ function viewconnections_content(&$a) { $is_owner = ((local_user() && local_user() == $a->profile['uid']) ? true : false); $abook_flags = ABOOK_FLAG_PENDING|ABOOK_FLAG_SELF; - $xchan_flags = XCHAN_FLAGS_ORPHAN|XCHAN_FLAGS_DELETED; + $sql_extra = ''; + if(! $is_owner) { $abook_flags = $abook_flags | ABOOK_FLAG_HIDDEN; - $xchan_flags = $xchan_flags | XCHAN_FLAGS_HIDDEN; + $sql_extra = " and xchan_hidden = 0 "; } - $r = q("SELECT count(*) as total FROM abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d and not (abook_flags & %d )>0 and not ( xchan_flags & %d )>0 ", + $r = q("SELECT count(*) as total FROM abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d and not (abook_flags & %d )>0 and xchan_orphan = 0 and xchan_deleted = 0 $sql_extra ", intval($a->profile['uid']), - intval($abook_flags), - intval($xchan_flags) + intval($abook_flags) ); if($r) { $a->set_pager_total($r[0]['total']); } - $r = q("SELECT * FROM abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d and not ( abook_flags & %d )>0 and not ( xchan_flags & %d )>0 order by xchan_name LIMIT %d OFFSET %d ", + $r = q("SELECT * FROM abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d and not ( abook_flags & %d )>0 and xchan_orphan = 0 and xchan_deleted = 0 $sql_extra order by xchan_name LIMIT %d OFFSET %d ", intval($a->profile['uid']), intval($abook_flags), - intval($xchan_flags), intval($a->pager['itemspage']), intval($a->pager['start']) ); -- cgit v1.2.3