]> git.wh0rd.org Git - tt-rss.git/commitdiff
reset counters on frontend catchup requests
authorAndrew Dolgov <fox@bah.spb.su>
Fri, 16 Jan 2009 14:07:22 +0000 (15:07 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Fri, 16 Jan 2009 14:07:22 +0000 (15:07 +0100)
backend.php
functions.php

index 109c6e586d1d479b23a2f42c849b78f195cab6bf..125968515a6493bb7bc2c560169fdb8bc1bdb47b 100644 (file)
                                case "catchupAll":
                                        db_query($link, "UPDATE ttrss_user_entries SET 
                                                last_read = NOW(),unread = false WHERE owner_uid = " . $_SESSION["uid"]);
+                                       ccache_zero_all($link, $_SESSION["uid"]);
+
                                break;
 
                                case "collapse":
index d659b22e89155c87fa823224ca1231e871e3b424..e84665999bf21f7571e8b92d74879170682bccc8 100644 (file)
                                                        AND owner_uid = ".$_SESSION["uid"]); */
                                        }
                                }
+
+                               ccache_update($link, $feed, $_SESSION["uid"], $cat_view);
+
                        } else { // tag
                                db_query($link, "BEGIN");
 
                        feed_id = '$feed_id' AND owner_uid = '$owner_uid'");
        }
 
-       function ccache_invalidate($link, $feed_id, $owner_uid, $is_cat = false) {
+       function ccache_zero_all($link, $owner_uid) {
+               db_query($link, "UPDATE ttrss_counters_cache SET
+                       value = 0 WHERE owner_uid = '$owner_uid'");
+
+               db_query($link, "UPDATE ttrss_cat_counters_cache SET
+                       value = 0 WHERE owner_uid = '$owner_uid'");
+       }
+
+/*     function ccache_invalidate($link, $feed_id, $owner_uid, $is_cat = false) {
 
                if (!$is_cat) {
                        $table = "ttrss_counters_cache";
 
                db_query($link, "DELETE FROM $table
                        WHERE feed_id = '$feed_id' AND owner_uid = '$owner_uid'");
-       }
+       } */
 
        function ccache_find($link, $feed_id, $owner_uid, $is_cat = false) {