]> git.wh0rd.org Git - tt-rss.git/commitdiff
rpc mark/pub return proper counters, rework all_counters_callback
authorAndrew Dolgov <fox@bah.spb.su>
Mon, 20 Aug 2007 12:58:11 +0000 (13:58 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Mon, 20 Aug 2007 12:58:11 +0000 (13:58 +0100)
functions.js
modules/backend-rpc.php
viewfeed.js

index 041311dfa484a7044367de153dc74f3807ec608b..a33302063ad9e5945d9fc5a9871d0fd84983a748 100644 (file)
@@ -782,11 +782,11 @@ function parse_counters_reply(xmlhttp, scheduled_call) {
                return fatalError(error_code, error_msg);
        }
 
-       var counters = reply.firstChild;
+       var counters = reply.getElementsByTagName("counters")[0];
        
        parse_counters(counters, scheduled_call);
 
-       var runtime_info = counters.nextSibling;
+       var runtime_info = reply.getElementsByTagName("runtime-info")[0];
 
        parse_runtime_info(runtime_info);
 
index 3303b25f9e49c5d0a572ae3880703ba51007f715..3a30543dd357eaa82e4fcb5356e0e6e5e5d89dab 100644 (file)
                        $result = db_query($link, "UPDATE ttrss_user_entries SET marked = $mark
                                WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]);
 
-                       print "<rpc-reply><mark>$id</mark></rpc-reply>";
+                       print "<rpc-reply><counters>";
+                       getGlobalCounters($link);
+                       getLabelCounters($link);
+                       if (get_pref($link, 'ENABLE_FEED_CATS')) {
+                               getCategoryCounters($link);
+                       }
+                       print "</counters></rpc-reply>";
 
                }
 
                        $result = db_query($link, "UPDATE ttrss_user_entries SET published = $pub
                                WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]);
 
-                       print "<rpc-reply><pub>$id</pub></rpc-reply>";
+                       print "<rpc-reply><counters>";
+                       getGlobalCounters($link);
+                       getLabelCounters($link);
+                       if (get_pref($link, 'ENABLE_FEED_CATS')) {
+                               getCategoryCounters($link);
+                       }
+                       print "</counters></rpc-reply>";
 
                }
 
index a9a413acb9ae763552bfee1e488ceded3fba9079..b1fbdd800604632139fffd3bec812dd07b8d8004 100644 (file)
@@ -440,6 +440,8 @@ function toggleMark(id) {
        
                //new Ajax.Request(query); */
 
+               debug(query);
+
                xmlhttp_rpc.open("GET", query, true);
                xmlhttp_rpc.onreadystatechange=all_counters_callback;
                xmlhttp_rpc.send(null);