cleanup
This commit is contained in:
parent
c8fb979ed8
commit
8c177fbc4b
@ -3931,23 +3931,25 @@ function items_fetch($arr,$channel = null,$observer_hash = null,$client_mode = C
|
|||||||
if(isset($arr['start']) && isset($arr['records']))
|
if(isset($arr['start']) && isset($arr['records']))
|
||||||
$pager_sql = sprintf(" LIMIT %d, %d ",intval($arr['start']), intval($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.
|
// 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
|
// 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
|
// recorded anywhere. So if cmax is 99, we'll open the search up to anybody in
|
||||||
// the stream with a NULL address book entry.
|
// the stream with a NULL address book entry.
|
||||||
|
|
||||||
$sql_nets .= " AND ";
|
$sql_nets .= " AND ";
|
||||||
|
|
||||||
if($arr['cmax'] == 99)
|
if($arr['cmax'] == 99)
|
||||||
$sql_nets .= " ( ";
|
$sql_nets .= " ( ";
|
||||||
|
|
||||||
$sql_nets .= "( abook.abook_closeness >= " . intval($arr['cmin']) . " ";
|
$sql_nets .= "( abook.abook_closeness >= " . intval($arr['cmin']) . " ";
|
||||||
$sql_nets .= " AND abook.abook_closeness <= " . intval($arr['cmax']) . " ) ";
|
$sql_nets .= " AND abook.abook_closeness <= " . intval($arr['cmax']) . " ) ";
|
||||||
if($cmax == 99)
|
if($cmax == 99)
|
||||||
$sql_nets .= " OR abook.abook_closeness IS NULL ) ";
|
$sql_nets .= " OR abook.abook_closeness IS NULL ) ";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$simple_update = (($client_mode & CLIENT_MODE_UPDATE) ? " and ( item.item_flags & " . intval(ITEM_UNSEEN) . " ) " : '');
|
$simple_update = (($client_mode & CLIENT_MODE_UPDATE) ? " and ( item.item_flags & " . intval(ITEM_UNSEEN) . " ) " : '');
|
||||||
if($client_mode & CLIENT_MODE_LOAD)
|
if($client_mode & CLIENT_MODE_LOAD)
|
||||||
|
@ -590,9 +590,10 @@ function RedCollectionData($file,&$auth) {
|
|||||||
if(! $r) {
|
if(! $r) {
|
||||||
// path wasn't found. Try without permissions to see if it was the result of permissions.
|
// path wasn't found. Try without permissions to see if it was the result of permissions.
|
||||||
$errors = true;
|
$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),
|
dbesc($folder),
|
||||||
basename($path_arr[$x]),
|
basename($path_arr[$x]),
|
||||||
|
intval($channel_id),
|
||||||
intval(ATTACH_FLAG_DIR)
|
intval(ATTACH_FLAG_DIR)
|
||||||
);
|
);
|
||||||
if($r) {
|
if($r) {
|
||||||
|
@ -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.
|
// 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?
|
// Are we a directory server of some kind?
|
||||||
|
|
||||||
if($dirmode != DIRECTORY_MODE_NORMAL) {
|
if($dirmode != DIRECTORY_MODE_NORMAL) {
|
||||||
|
@ -1 +1 @@
|
|||||||
2014-03-17.619
|
2014-03-18.620
|
||||||
|
Reference in New Issue
Block a user