aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-09-19 01:01:51 -0700
committerfriendica <info@friendica.com>2013-09-19 01:01:51 -0700
commit63fc92b9e5d75f0dda0aecaaa0e1feb56d2b9744 (patch)
tree415659dab562b71736a628be8beb7103bc543886 /include/items.php
parent14f6bf06e7d0dd7a851715bb081e2f2a55d79c2a (diff)
downloadvolse-hubzilla-63fc92b9e5d75f0dda0aecaaa0e1feb56d2b9744.tar.gz
volse-hubzilla-63fc92b9e5d75f0dda0aecaaa0e1feb56d2b9744.tar.bz2
volse-hubzilla-63fc92b9e5d75f0dda0aecaaa0e1feb56d2b9744.zip
sync item_search with yesterday's network fix for collections. Add ud_addr to update table to store the target address since it's possible the mirroring directory won't yet have an xchan or hubloc they can link the ud_hash to and therefore mayn't know how to contact them.
Diffstat (limited to 'include/items.php')
-rwxr-xr-xinclude/items.php18
1 files changed, 12 insertions, 6 deletions
diff --git a/include/items.php b/include/items.php
index c83eceabe..a60e3fdd6 100755
--- a/include/items.php
+++ b/include/items.php
@@ -3645,16 +3645,22 @@ function items_fetch($arr,$channel = null,$observer_hash = null,$client_mode = C
return $result;
}
- $contacts = expand_groups(array($arr['group']));
- if((is_array($contacts)) && count($contacts)) {
- $contact_str = implode(',',$contacts);
+
+ $contact_str = '';
+ $contacts = group_get_members($group);
+ if($contacts) {
+ foreach($contacts as $c) {
+ if($contact_str)
+ $contact_str .= ',';
+ $contact_str .= "'" . $c['xchan'] . "'";
+ }
}
else {
- $contact_str = ' 0 ';
- $result['message'] = t('Collection has no members.');
+ $contact_str = ' 0 ';
+ info( t('Group is empty'));
}
- $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($r[0]['hash']) . '>%') . "' ) and item_restrict = 0 ) ";
+ $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($r[0]['hash']) . '>%') . "' ) and item_restrict = 0 ) ";
}
elseif($arr['cid'] && $uid) {