$simple_update isn't so simple any more. Make sure we don't re-itnroduce the bug that session['loadtime'] was created to fix. It's questionable whether we still need to even look for item_unseen but I won't make that call today. We can also eliminate the restriction on not doing live updates from the discover tab since we aren't relying completely on item_unseen (which can only be set by the owner and won't work on a page with virtual owners).
This commit is contained in:
parent
f5f194c92b
commit
2bd19e6b51
@ -159,7 +159,7 @@ function channel_content(&$a, $update = 0, $load = false) {
|
|||||||
$simple_update = (($update) ? " AND item_unseen = 1 " : '');
|
$simple_update = (($update) ? " AND item_unseen = 1 " : '');
|
||||||
|
|
||||||
if($update && $_SESSION['loadtime'])
|
if($update && $_SESSION['loadtime'])
|
||||||
$simple_update = " AND ( item_unseen = 1 or item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) ";
|
$simple_update = " AND (( item_unseen = 1 AND item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) OR item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) ";
|
||||||
if($load)
|
if($load)
|
||||||
$simple_update = '';
|
$simple_update = '';
|
||||||
|
|
||||||
|
@ -185,7 +185,7 @@ function home_content(&$a, $update = 0, $load = false) {
|
|||||||
$simple_update = (($update) ? " and item.item_unseen = 1 " : '');
|
$simple_update = (($update) ? " and item.item_unseen = 1 " : '');
|
||||||
|
|
||||||
if($update && $_SESSION['loadtime'])
|
if($update && $_SESSION['loadtime'])
|
||||||
$simple_update = " AND ( item_unseen = 1 or item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) ";
|
$simple_update = " AND (( item_unseen = 1 AND item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) OR item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) ";
|
||||||
if($load)
|
if($load)
|
||||||
$simple_update = '';
|
$simple_update = '';
|
||||||
|
|
||||||
|
@ -396,7 +396,7 @@ function network_content(&$a, $update = 0, $load = false) {
|
|||||||
// which are both ITEM_UNSEEN and have "changed" since that time. Cross fingers...
|
// which are both ITEM_UNSEEN and have "changed" since that time. Cross fingers...
|
||||||
|
|
||||||
if($update && $_SESSION['loadtime'])
|
if($update && $_SESSION['loadtime'])
|
||||||
$simple_update = " AND ( item_unseen = 1 or item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) ";
|
$simple_update = " AND (( item_unseen = 1 AND item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) OR item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) ";
|
||||||
if($load)
|
if($load)
|
||||||
$simple_update = '';
|
$simple_update = '';
|
||||||
|
|
||||||
@ -444,17 +444,15 @@ function network_content(&$a, $update = 0, $load = false) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(! $firehose) {
|
// this is an update
|
||||||
// this is an update
|
$r = q("SELECT item.parent AS item_id FROM item
|
||||||
$r = q("SELECT item.parent AS item_id FROM item
|
left join abook on ( item.owner_xchan = abook.abook_xchan $abook_uids )
|
||||||
left join abook on ( item.owner_xchan = abook.abook_xchan $abook_uids )
|
WHERE true $uids AND item.item_restrict = 0 $simple_update
|
||||||
WHERE true $uids AND item.item_restrict = 0 $simple_update
|
and ((abook.abook_flags & %d) = 0 or abook.abook_flags is null)
|
||||||
and ((abook.abook_flags & %d) = 0 or abook.abook_flags is null)
|
$sql_extra3 $sql_extra $sql_nets ",
|
||||||
$sql_extra3 $sql_extra $sql_nets ",
|
intval(ABOOK_FLAG_BLOCKED)
|
||||||
intval(ABOOK_FLAG_BLOCKED)
|
);
|
||||||
);
|
$_SESSION['loadtime'] = datetime_convert();
|
||||||
$_SESSION['loadtime'] = datetime_convert();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Then fetch all the children of the parents that are on this page
|
// Then fetch all the children of the parents that are on this page
|
||||||
|
Reference in New Issue
Block a user