1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 07:25:54 +00:00

offline: sync marked/unread status (performance tweak)

This commit is contained in:
Andrew Dolgov
2009-02-17 12:30:54 +03:00
parent 492a4a6ac8
commit 5b8444d371

View File

@@ -545,9 +545,15 @@
$id = (int) $e[0];
$unread = bool_to_sql_bool((bool) $e[1]);
$marked = bool_to_sql_bool((bool) $e[2]);
$marked = (bool)$e[2];
if ($marked) {
$marked = bool_to_sql_bool($marked);
$marked_qpart = "marked = $marked,";
}
$query = "UPDATE ttrss_user_entries SET
$marked_qpart
unread = $unread,
last_read = '$last_online'
WHERE ref_id = '$id' AND
@@ -556,17 +562,6 @@
$result = db_query($link, $query);
if ($marked) {
$query = "UPDATE ttrss_user_entries SET
marked = $marked,
last_read = '$last_online'
WHERE ref_id = '$id' AND
(last_read IS NULL OR last_read < '$last_online') AND
owner_uid = ".$_SESSION["uid"];
$result = db_query($link, $query);
}
print "<sync-ok id=\"$id\"/>";
}