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.

This commit is contained in:
friendica 2013-09-19 01:01:51 -07:00
parent 14f6bf06e7
commit 63fc92b9e5
5 changed files with 26 additions and 10 deletions

View File

@ -44,7 +44,7 @@ require_once('include/taxonomy.php');
define ( 'RED_PLATFORM', 'Red Matrix' ); define ( 'RED_PLATFORM', 'Red Matrix' );
define ( 'RED_VERSION', trim(file_get_contents('version.inc')) . 'R'); define ( 'RED_VERSION', trim(file_get_contents('version.inc')) . 'R');
define ( 'ZOT_REVISION', 1 ); define ( 'ZOT_REVISION', 1 );
define ( 'DB_UPDATE_VERSION', 1071 ); define ( 'DB_UPDATE_VERSION', 1072 );
define ( 'EOL', '<br />' . "\r\n" ); define ( 'EOL', '<br />' . "\r\n" );
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' ); define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );

View File

@ -3645,16 +3645,22 @@ function items_fetch($arr,$channel = null,$observer_hash = null,$client_mode = C
return $result; return $result;
} }
$contacts = expand_groups(array($arr['group']));
if((is_array($contacts)) && count($contacts)) { $contact_str = '';
$contact_str = implode(',',$contacts); $contacts = group_get_members($group);
if($contacts) {
foreach($contacts as $c) {
if($contact_str)
$contact_str .= ',';
$contact_str .= "'" . $c['xchan'] . "'";
}
} }
else { else {
$contact_str = ' 0 '; $contact_str = ' 0 ';
$result['message'] = t('Collection has no members.'); 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) { elseif($arr['cid'] && $uid) {

View File

@ -892,11 +892,13 @@ CREATE TABLE IF NOT EXISTS `updates` (
`ud_guid` char(255) NOT NULL DEFAULT '', `ud_guid` char(255) NOT NULL DEFAULT '',
`ud_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `ud_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`ud_flags` int(11) NOT NULL DEFAULT '0', `ud_flags` int(11) NOT NULL DEFAULT '0',
`ud_addr` char(255) NOT NULL DEFAULT '',
PRIMARY KEY (`ud_id`), PRIMARY KEY (`ud_id`),
KEY `ud_hash` (`ud_hash`), KEY `ud_hash` (`ud_hash`),
KEY `ud_guid` (`ud_guid`), KEY `ud_guid` (`ud_guid`),
KEY `ud_date` (`ud_date`), KEY `ud_date` (`ud_date`),
KEY `ud_flags` (`ud_flags`) KEY `ud_flags` (`ud_flags`),
KEY `ud_addr` (`ud_addr`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `verify` ( CREATE TABLE IF NOT EXISTS `verify` (

View File

@ -1,6 +1,6 @@
<?php <?php
define( 'UPDATE_VERSION' , 1071 ); define( 'UPDATE_VERSION' , 1072 );
/** /**
* *
@ -805,3 +805,11 @@ ADD INDEX ( `ud_flags` )");
return UPDATE_FAILED; return UPDATE_FAILED;
} }
function update_r1071() {
$r = q("ALTER TABLE `updates` ADD `ud_addr` CHAR( 255 ) NOT NULL DEFAULT '',
ADD INDEX ( `ud_addr` ) ");
if($r)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}

View File

@ -1 +1 @@
2013-09-18.440 2013-09-19.441