]> git.wh0rd.org Git - tt-rss.git/commitdiff
remove previous counter hacks; force request counters when there's no
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Wed, 27 Feb 2013 12:57:26 +0000 (16:57 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Wed, 27 Feb 2013 12:57:26 +0000 (16:57 +0400)
unread stuff left in current feed (e.g. finished reading)

classes/rpc.php
js/feedlist.js
js/viewfeed.js

index 18df21b16a317082dbec25bb1cdf7570adad2d02..46c8b0d85eba96f94efddf5c0a633df00dbfc489 100644 (file)
@@ -247,8 +247,6 @@ class RPC extends Handler_Protected {
 
                if ($last_article_id != getLastArticleId($this->link)) {
                        $reply['counters'] = getAllCounters($this->link);
-               } else {
-                       $reply['counters'] = getVirtCounters($this->link);
                }
 
                $reply['runtime-info'] = make_runtime_info($this->link);
index a9ee19c066c10c9f6f17d9f02c527f060b67ba84..b2aadab628ea25c8afeb3d2b968173b700a40ac2 100644 (file)
@@ -234,7 +234,7 @@ function request_counters(force) {
 
                        var query = "?op=rpc&method=getAllCounters&seq=" + next_seq();
 
-                       if (!force && Math.random() >= 0.5)
+                       if (!force)
                                query = query + "&last_article_id=" + getInitParam("last_article_id");
 
                        console.log(query);
index 1cdfdba3f62a11d963ddeafb68328f43e4fa0ca9..2f1ba24e010572b860c7d82871d4975c3bdb2659 100644 (file)
@@ -325,7 +325,8 @@ function article_callback2(transport, id) {
                        Element.show(dijit.byId("net-alert").domNode);
                }
 
-               request_counters();
+               var unread_in_buffer = $$("#headlines-frame > div[id*=RROW][class*=Unread]").length
+               request_counters(unread_in_buffer == 0);
 
                headlines_scroll_handler($("headlines-frame"));
 
@@ -1550,7 +1551,8 @@ function cdmClicked(event, id) {
                        openArticleInNewWindow(id);
                }
 
-               request_counters();
+               var unread_in_buffer = $$("#headlines-frame > div[id*=RROW][class*=Unread]").length
+               request_counters(unread_in_buffer == 0);
 
        } catch (e) {
                exception_error("cdmClicked");