summaryrefslogtreecommitdiff
path: root/modules/backend-rpc.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2009-02-17 12:30:54 +0300
committerAndrew Dolgov <[email protected]>2009-02-17 12:30:54 +0300
commit5b8444d371d2d55781eddf250eeb964a07a529b5 (patch)
treee7cb3987ff3cd02993e60855457336c82f771fd3 /modules/backend-rpc.php
parent492a4a6ac8c63239ecf67fda0acfc2afca9df457 (diff)
offline: sync marked/unread status (performance tweak)
Diffstat (limited to 'modules/backend-rpc.php')
-rw-r--r--modules/backend-rpc.php19
1 files changed, 7 insertions, 12 deletions
diff --git a/modules/backend-rpc.php b/modules/backend-rpc.php
index d7700d66a..afcd82d3f 100644
--- a/modules/backend-rpc.php
+++ b/modules/backend-rpc.php
@@ -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\"/>";
}