This commit is contained in:
friendica 2014-03-18 16:50:46 -07:00
parent c8fb979ed8
commit 8c177fbc4b
4 changed files with 37 additions and 27 deletions

View File

@ -3931,23 +3931,25 @@ function items_fetch($arr,$channel = null,$observer_hash = null,$client_mode = C
if(isset($arr['start']) && isset($arr['records']))
$pager_sql = sprintf(" LIMIT %d, %d ",intval($arr['start']), intval($arr['records']));
if(($arr['cmin'] != 0) || ($arr['cmax'] != 99)) {
if(array_key_exists('cmin',$arr) || array_key_exists('cmax',$arr)) {
if(($arr['cmin'] != 0) || ($arr['cmax'] != 99)) {
// Not everybody who shows up in the network stream will be in your address book.
// By default those that aren't are assumed to have closeness = 99; but this isn't
// recorded anywhere. So if cmax is 99, we'll open the search up to anybody in
// the stream with a NULL address book entry.
// Not everybody who shows up in the network stream will be in your address book.
// By default those that aren't are assumed to have closeness = 99; but this isn't
// recorded anywhere. So if cmax is 99, we'll open the search up to anybody in
// the stream with a NULL address book entry.
$sql_nets .= " AND ";
$sql_nets .= " AND ";
if($arr['cmax'] == 99)
$sql_nets .= " ( ";
if($arr['cmax'] == 99)
$sql_nets .= " ( ";
$sql_nets .= "( abook.abook_closeness >= " . intval($arr['cmin']) . " ";
$sql_nets .= " AND abook.abook_closeness <= " . intval($arr['cmax']) . " ) ";
if($cmax == 99)
$sql_nets .= " OR abook.abook_closeness IS NULL ) ";
}
$sql_nets .= "( abook.abook_closeness >= " . intval($arr['cmin']) . " ";
$sql_nets .= " AND abook.abook_closeness <= " . intval($arr['cmax']) . " ) ";
if($cmax == 99)
$sql_nets .= " OR abook.abook_closeness IS NULL ) ";
}
}
$simple_update = (($client_mode & CLIENT_MODE_UPDATE) ? " and ( item.item_flags & " . intval(ITEM_UNSEEN) . " ) " : '');
if($client_mode & CLIENT_MODE_LOAD)

View File

@ -590,9 +590,10 @@ function RedCollectionData($file,&$auth) {
if(! $r) {
// path wasn't found. Try without permissions to see if it was the result of permissions.
$errors = true;
$r = q("select id, hash, filename, flags from attach where folder = '%s' and filename = '%s' and (flags & %d) limit 1",
$r = q("select id, hash, filename, flags from attach where folder = '%s' and filename = '%s' and uid = %d and (flags & %d) limit 1",
dbesc($folder),
basename($path_arr[$x]),
intval($channel_id),
intval(ATTACH_FLAG_DIR)
);
if($r) {

View File

@ -872,21 +872,28 @@ function import_xchan($arr,$ud_flags = UPDATE_FLAGS_UPDATED) {
}
// get rid of any hubs we have for this channel which weren't reported.
// This was needed at one time to resolve complicated cross-site inconsistencies, but can cause sync conflict.
// currently disabled.
// if($xisting) {
// foreach($xisting as $x) {
// if(! array_key_exists('updated',$x)) {
// logger('import_xchan: removing unreferenced hub location ' . $x['hubloc_url']);
// $r = q("delete from hubloc where hubloc_id = %d limit 1",
// intval($x['hubloc_id'])
// );
// $what .= 'removed_hub';
// $changed = true;
// }
// }
// }
if($xisting) {
foreach($xisting as $x) {
if(! array_key_exists('updated',$x)) {
logger('import_xchan: removing unreferenced hub location ' . $x['hubloc_url']);
$r = q("delete from hubloc where hubloc_id = %d limit 1",
intval($x['hubloc_id'])
);
$what .= 'removed_hub';
$changed = true;
}
}
}
}
// Are we a directory server of some kind?
if($dirmode != DIRECTORY_MODE_NORMAL) {

View File

@ -1 +1 @@
2014-03-17.619
2014-03-18.620