diff options
author | zotlabs <mike@macgirvin.com> | 2018-04-25 22:53:20 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2018-04-25 22:53:20 -0700 |
commit | fe724acc3b78af5ed86b4bf0ff58bdd9b56356e2 (patch) | |
tree | 3c6c7172426d655fecdc9de7c341d1cfcf28ff1b | |
parent | 4409b2b40a2c088ede7b23ae19cd1d56f8db3c78 (diff) | |
download | volse-hubzilla-fe724acc3b78af5ed86b4bf0ff58bdd9b56356e2.tar.gz volse-hubzilla-fe724acc3b78af5ed86b4bf0ff58bdd9b56356e2.tar.bz2 volse-hubzilla-fe724acc3b78af5ed86b4bf0ff58bdd9b56356e2.zip |
mod_network: privacy group query returning results when group is empty. Notification that the group is empty was also displayed twice.
-rw-r--r-- | Zotlabs/Module/Network.php | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/Zotlabs/Module/Network.php b/Zotlabs/Module/Network.php index 8d017207b..e97ebf1d0 100644 --- a/Zotlabs/Module/Network.php +++ b/Zotlabs/Module/Network.php @@ -218,15 +218,13 @@ class Network extends \Zotlabs\Web\Controller { $contact_str = ''; $contacts = group_get_members($group); if($contacts) { - foreach($contacts as $c) { - if($contact_str) - $contact_str .= ','; - $contact_str .= "'" . $c['xchan'] . "'"; - } + $contact_str = ids_to_querystr($contacts,'xchan',true); } else { - $contact_str = ' 0 '; - info( t('Privacy group is empty')); + $contact_str = " '0' "; + if(! $update) { + info( t('Privacy group is empty')); + } } $item_thread_top = ''; $sql_extra = " AND item.parent IN ( SELECT DISTINCT parent FROM item WHERE true $sql_options AND (( author_xchan IN ( $contact_str ) OR owner_xchan in ( $contact_str )) or allow_gid like '" . protect_sprintf('%<' . dbesc($group_hash) . '>%') . "' ) and id = parent $item_normal ) "; @@ -480,7 +478,6 @@ class Network extends \Zotlabs\Web\Controller { $ordering = "commented"; if($load) { - // Fetch a page full of parent items for this page $r = q("SELECT item.parent AS item_id FROM item left join abook on ( item.owner_xchan = abook.abook_xchan $abook_uids ) |