]> git.wh0rd.org Git - tt-rss.git/commitdiff
change various catchup stuff to only affect unread articles
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 26 Feb 2013 18:49:46 +0000 (22:49 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 26 Feb 2013 18:49:46 +0000 (22:49 +0400)
classes/feeds.php
include/functions.php

index fed960565406c4a94adf5df4d2bcf5be16335a03..a2e19d5809ccc4d47c469a5ad9f59855446630e3 100644 (file)
@@ -745,7 +745,7 @@ class Feeds extends Handler_Protected {
 
        function catchupAll() {
                db_query($this->link, "UPDATE ttrss_user_entries SET
-                                               last_read = NOW(),unread = false WHERE owner_uid = " . $_SESSION["uid"]);
+                                               last_read = NOW(), unread = false WHERE unread = true AND owner_uid = " . $_SESSION["uid"]);
                ccache_zero_all($this->link, $_SESSION["uid"]);
        }
 
index 4d3051a0c3c0c6fd878f0240228a69997b6aed25..00193c995fd6f66fc82bf770bbe91b8108c0b128 100644 (file)
                                                db_query($link, "UPDATE ttrss_user_entries
                                                        SET unread = false,last_read = NOW()
                                                        WHERE feed_id IN (SELECT id FROM ttrss_feeds WHERE $cat_qpart)
-                                                       AND $ref_check_qpart
+                                                       AND $ref_check_qpart AND unread = true
                                                        AND owner_uid = $owner_uid");
 
                                        } else if ($feed == -2) {
                                        db_query($link, "UPDATE ttrss_user_entries
                                                        SET unread = false,last_read = NOW()
                                                        WHERE feed_id = '$feed'
-                                                       AND $ref_check_qpart
+                                                       AND $ref_check_qpart AND unread = true
                                                        AND owner_uid = $owner_uid");
 
                                } else if ($feed < 0 && $feed > -10) { // special, like starred
                                                db_query($link, "UPDATE ttrss_user_entries
                                                        SET unread = false,last_read = NOW()
                                                        WHERE marked = true
-                                                       AND $ref_check_qpart
+                                                       AND $ref_check_qpart AND unread = true
                                                        AND owner_uid = $owner_uid");
                                        }
 
                                                db_query($link, "UPDATE ttrss_user_entries
                                                        SET unread = false,last_read = NOW()
                                                        WHERE published = true
-                                                       AND $ref_check_qpart
+                                                       AND $ref_check_qpart AND unread = true
                                                        AND owner_uid = $owner_uid");
                                        }
 
                                        if ($feed == -4) {
                                                db_query($link, "UPDATE ttrss_user_entries
                                                        SET unread = false,last_read = NOW()
-                                                       WHERE $ref_check_qpart AND owner_uid = $owner_uid");
+                                                       WHERE $ref_check_qpart AND unread = true AND
+                                                       owner_uid = $owner_uid");
                                        }
 
                                } else if ($feed < -10) { // label
                                while ($line = db_fetch_assoc($result)) {
                                        db_query($link, "UPDATE ttrss_user_entries SET
                                                unread = false, last_read = NOW()
-                                               WHERE $ref_check_qpart AND int_id = " . $line["post_int_id"]);
+                                               WHERE $ref_check_qpart AND unread = true
+                                               AND int_id = " . $line["post_int_id"]);
                                }
                                db_query($link, "COMMIT");
                        }