fall back to unseen items if no timestamp is available
This commit is contained in:
parent
5a7b9676ff
commit
88602de604
|
@ -210,13 +210,15 @@ function profile_content(App $a, $update = 0) {
|
||||||
|
|
||||||
|
|
||||||
if ($update) {
|
if ($update) {
|
||||||
|
$last_updated = (x($_SESSION['last_updated'], $last_updated_key) ? $_SESSION['last_updated'][$last_updated_key] : 0);
|
||||||
|
|
||||||
// If the page user is the owner of the page we should query for unseen
|
// If the page user is the owner of the page we should query for unseen
|
||||||
// items. Otherwise use a timestamp of the last succesful update request.
|
// items. Otherwise use a timestamp of the last succesful update request.
|
||||||
if ($is_owner) {
|
if ($is_owner || !$last_updated) {
|
||||||
$sql_extra4 = " AND `item`.`unseen`";
|
$sql_extra4 = " AND `item`.`unseen`";
|
||||||
} else {
|
} else {
|
||||||
$last_updated = gmdate("Y-m-d H:i:s", $_SESSION['last_updated'][$last_updated_key]);
|
$gmupdate = gmdate("Y-m-d H:i:s", $last_updated);
|
||||||
$sql_extra4 = " AND `item`.`received` > '" . $last_updated . "'";
|
$sql_extra4 = " AND `item`.`received` > '" . $gmupdate . "'";
|
||||||
}
|
}
|
||||||
|
|
||||||
$r = q("SELECT distinct(parent) AS `item_id`, `item`.`network` AS `item_network`, `item`.`created`
|
$r = q("SELECT distinct(parent) AS `item_id`, `item`.`network` AS `item_network`, `item`.`created`
|
||||||
|
|
Loading…
Reference in a new issue