summaryrefslogtreecommitdiff
path: root/tt-rss.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2006-12-06 09:55:58 +0100
committerAndrew Dolgov <[email protected]>2006-12-06 09:55:58 +0100
commit5854573ad3f8137d123b7f0d196f1c0e38dcb1d4 (patch)
tree6637ee885c1b17a46df3a416969474490e8779b5 /tt-rss.js
parente3612080e8b84ad55742b1761ac03cc162b59e1d (diff)
unify counter reply object handling when called from auto refetch and manually
Diffstat (limited to 'tt-rss.js')
-rw-r--r--tt-rss.js39
1 files changed, 1 insertions, 38 deletions
diff --git a/tt-rss.js b/tt-rss.js
index b53f9db7c..07734bacc 100644
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -62,44 +62,7 @@ function refetch_callback() {
last_refetch = date.getTime() / 1000;
- if (!xmlhttp_ctr.responseXML) {
- notify("refetch_callback: backend did not return valid XML", true, true);
- return;
- }
-
- var reply = xmlhttp_ctr.responseXML.firstChild;
-
- if (!reply) {
- notify("refetch_callback: backend did not return expected XML object", true, true);
- updateTitle("");
- return;
- }
-
- var error_code = false;
- var error_msg = false;
-
- if (reply.firstChild) {
- error_code = reply.firstChild.getAttribute("error-code");
- error_msg = reply.firstChild.getAttribute("error-msg");
- }
-
- if (!error_code) {
- error_code = reply.getAttribute("error-code");
- error_msg = reply.getAttribute("error-msg");
- }
-
- if (error_code && error_code != 0) {
- debug("refetch_callback: got error code " + error_code);
- return fatalError(error_code, error_msg);
- }
-
- var counters = reply.firstChild;
-
- parse_counters(counters, true);
-
- var runtime_info = counters.nextSibling;
-
- parse_runtime_info(runtime_info);
+ parse_counters_reply(xmlhttp_ctr);
debug("refetch_callback: done");