]> git.wh0rd.org Git - tt-rss.git/commitdiff
unify backend methods updateAllFeeds and getAllCounters
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Wed, 10 Nov 2010 16:18:13 +0000 (19:18 +0300)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Wed, 10 Nov 2010 16:18:13 +0000 (19:18 +0300)
modules/backend-rpc.php
tt-rss.js

index f28e72475510b902523a5b2bd7c4a01370f2eb54..e6e263cd130ceb1664d91206512e24201b03d861 100644 (file)
                        return;
                }
 
-               if ($subop == "getAllCounters") {
-                       print "<rpc-reply>";                    
-                       print "<counters><![CDATA[";
-
-                       print json_encode(getAllCounters($link, $_REQUEST['omode']));
-
-                       print "]]></counters>";
-                       print_runtime_info($link);
-                       print "</rpc-reply>";
-
-                       return;
-               }
-
                if ($subop == "mark") {
                        $mark = $_REQUEST["mark"];
                        $id = db_escape_string($_REQUEST["id"]);
                        return;
                }
 
-               if ($subop == "updateAllFeeds") {
+               if ($subop == "updateAllFeeds" || $subop == "getAllCounters") {
        
                        $global_unread_caller = sprintf("%d", $_REQUEST["uctr"]);
                        $global_unread = getGlobalUnread($link);
index 130beeed0fe56451c864eb799f7306235c7e1377..a3b18449647dd67b2a2ecfdd55cc4e489da871a3 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -94,9 +94,9 @@ function dlg_frefresh_callback(transport, deleted_feed) {
 
 function scheduleFeedUpdate() {
 
-       console.log("in scheduleFeedUpdate");
+       window.clearTimeout(counter_timeout_id);
 
-       var query_str = "backend.php?op=rpc&subop=updateAllFeeds";
+       var query_str = "backend.php?op=rpc&subop=getAllCounters";
 
        var omode;
 
@@ -114,7 +114,7 @@ function scheduleFeedUpdate() {
        query_str = query_str + "&omode=" + omode;
        query_str = query_str + "&uctr=" + global_unread;
 
-       console.log("REFETCH query: " + query_str);
+       console.log("[scheduleFeedUpdate] " + query_str);
 
        new Ajax.Request("backend.php", {
                parameters: query_str,