}
}
- if ($mode != "prefetch_old") {
+/* if ($mode != "prefetch_old") {
print "<counters>";
getAllCounters($link, $omode);
print "</counters>";
- }
+ } */
print "</reply>";
break; // view
}
}
-function request_counters() {
+function request_counters_real() {
try {
var query = "backend.php?op=rpc&subop=getAllCounters";
}
} });
+ } catch (e) {
+ exception_error("request_counters_real", e);
+ }
+}
+
+var counters_last_request = 0;
+
+function request_counters() {
+
+ try {
+
+ var date = new Date();
+ var timestamp = Math.round(date.getTime() / 1000);
+
+ if (timestamp - counters_last_request > 10) {
+ debug("scheduling request of counters...");
+ window.setTimeout("request_counters_real()", 100);
+ counters_last_request = timestamp;
+ } else {
+ debug("request_counters: rate limit reached: " + (timestamp - counters_last_request));
+ }
+
} catch (e) {
exception_error("request_counters", e);
}
active_real_feed_id = feed_id;
active_post_id = id;
- //showArticleInHeadlines(id);
+ showArticleInHeadlines(id);
var reply = transport.responseXML.firstChild.firstChild;
debug("parsing piggybacked counters: " + counters);
parse_counters(counters, false);
} else {
- debug("counters container not found in reply");
+ debug("counters container not found in reply, requesting...");
+ request_counters();
}
}
var crow = document.getElementById("RROW-" + id);
var article_is_unread = crow.className.match("Unread");
- showArticleInHeadlines(id);
-
if (!cached_article) {
notify_progress("Loading, please wait...");
query = query + "&mode=prefetch_old";
render_article(cached_article);
+ showArticleInHeadlines(id);
+
}
cache_expire();