]> git.wh0rd.org Git - tt-rss.git/commitdiff
fix updateFeed rpc call, fix feed editor feed catchup/uncatchup
authorAndrew Dolgov <fox@bah.spb.su>
Sat, 19 Nov 2005 17:49:53 +0000 (18:49 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Sat, 19 Nov 2005 17:49:53 +0000 (18:49 +0100)
backend.php
tt-rss.js

index a7fe0ff38dc8f319a3dbd868a96cfddc475a1884..5a65421ccaeb01dbb4e8763130dc43bcbaff2a30 100644 (file)
                        $feed_id = db_escape_string($_GET["feed"]);
 
                        $result = db_query($link, 
-                               "SELECT feed_url FROM ttrss_feeds WHERE id = '$feed_id'");
+                               "SELECT feed_url FROM ttrss_feeds WHERE id = '$feed_id'
+                                       AND owner_uid = " . $_SESSION["uid"]);
 
                        if (db_num_rows($result) > 0) {                 
                                $feed_url = db_fetch_result($result, 0, "feed_url");
-//                             update_rss_feed($link, $feed_url, $feed_id);
+                               update_rss_feed($link, $feed_url, $feed_id);
                        }
 
-                       print "DONE-$feed_id";
-
+                       print "<rpc-reply>";
+                       getFeedCounter($link, $feed_id);
+                       print "</rpc-reply>";
+                       
                        return;
                }
 
                if ($subop == "unread") {
                        $ids = split(",", $_GET["ids"]);
                        foreach ($ids as $id) {
-                               db_query($link, "UPDATE ttrss_entries SET unread = true WHERE feed_id = '$id'");
+                               db_query($link, "UPDATE ttrss_user_entries SET unread = true 
+                                       WHERE feed_id = '$id' AND owner_uid = ".$_SESSION["uid"]);
                        }
 
-                       print "Marked selected feeds as read.";
+                       print "Marked selected feeds as unread.";
                }
 
                if ($subop == "read") {
                        $ids = split(",", $_GET["ids"]);
                        foreach ($ids as $id) {
-                               db_query($link, "UPDATE ttrss_entries 
-                                       SET unread = false,last_read = NOW() WHERE feed_id = '$id'");
+                               db_query($link, "UPDATE ttrss_user_entries 
+                                       SET unread = false,last_read = NOW() WHERE 
+                                               feed_id = '$id' AND owner_uid = ".$_SESSION["uid"]);
                        }
 
-                       print "Marked selected feeds as unread.";
+                       print "Marked selected feeds as read.";
 
                }
 
index 70412fcb42762d6cb751bed0977b244f43224cc7..922ae35bc1f7e36206985093f596ea6d13a70d8f 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -149,6 +149,7 @@ function backend_sanity_check_callback() {
        } 
 }
 
+/* wtf this is obsolete
 function updateFeed(feed_id) {
 
        var query_str = "backend.php?op=rpc&subop=updateFeed&feed=" + feed_id;
@@ -162,6 +163,7 @@ function updateFeed(feed_id) {
        }   
 
 }
+*/
 
 function scheduleFeedUpdate(force) {