]> git.wh0rd.org - tt-rss.git/commitdiff
support for ccache updates in catchupArticlesById()
authorAndrew Dolgov <fox@bah.spb.su>
Fri, 16 Jan 2009 15:02:47 +0000 (16:02 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Fri, 16 Jan 2009 15:02:47 +0000 (16:02 +0100)
backend.php
functions.php

index 125968515a6493bb7bc2c560169fdb8bc1bdb47b..71a9522583bcc803d83f39d1dc34d2897e24c4af 100644 (file)
                        $csync = $_GET["csync"];
                        $order_by = db_escape_string($_GET["order_by"]);
 
+                       ccache_update($link, $feed, $_SESSION["uid"]);
+
                        set_pref($link, "_DEFAULT_VIEW_MODE", $view_mode);
                        set_pref($link, "_DEFAULT_VIEW_LIMIT", $limit);
                        set_pref($link, "_DEFAULT_VIEW_ORDER_BY", $order_by);
                                print "<headlines-count value=\"$headlines_count\"/>";
                                print "<vgroup-last-feed value=\"$vgroup_last_feed\"/>";
 
-                               $headlines_unread = getFeedUnread($link, $returned_feed);
+                               $headlines_unread = ccache_find($link, $returned_feed, $_SESSION["uid"]);
        
                                print "<headlines-unread value=\"$headlines_unread\"/>";
                                printf("<disable-cache value=\"%d\"/>", $disable_cache);
index e84665999bf21f7571e8b92d74879170682bccc8..50f5f7236866556b37e4123da06eb03f00f0a2a6 100644 (file)
                        unread = NOT unread,last_read = NOW()
                        WHERE ($ids_qpart) AND owner_uid = $owner_uid");
                }
+
+               /* update ccache */
+
+               $result = db_query($link, "SELECT DISTINCT feed_id FROM ttrss_user_entries
+                       WHERE ($ids_qpart) AND owner_uid = $owner_uid");
+
+               while ($line = db_fetch_assoc($result)) {
+                       ccache_update($link, $line["feed_id"], $owner_uid);
+               }
        }
 
        function catchupArticleById($link, $id, $cmode) {