unify backend methods updateAllFeeds and getAllCounters
This commit is contained in:
parent
3d28f9cd2d
commit
773adf8b42
|
@ -164,19 +164,6 @@
|
||||||
return;
|
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") {
|
if ($subop == "mark") {
|
||||||
$mark = $_REQUEST["mark"];
|
$mark = $_REQUEST["mark"];
|
||||||
$id = db_escape_string($_REQUEST["id"]);
|
$id = db_escape_string($_REQUEST["id"]);
|
||||||
|
@ -296,7 +283,7 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($subop == "updateAllFeeds") {
|
if ($subop == "updateAllFeeds" || $subop == "getAllCounters") {
|
||||||
|
|
||||||
$global_unread_caller = sprintf("%d", $_REQUEST["uctr"]);
|
$global_unread_caller = sprintf("%d", $_REQUEST["uctr"]);
|
||||||
$global_unread = getGlobalUnread($link);
|
$global_unread = getGlobalUnread($link);
|
||||||
|
|
|
@ -94,9 +94,9 @@ function dlg_frefresh_callback(transport, deleted_feed) {
|
||||||
|
|
||||||
function scheduleFeedUpdate() {
|
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;
|
var omode;
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@ function scheduleFeedUpdate() {
|
||||||
query_str = query_str + "&omode=" + omode;
|
query_str = query_str + "&omode=" + omode;
|
||||||
query_str = query_str + "&uctr=" + global_unread;
|
query_str = query_str + "&uctr=" + global_unread;
|
||||||
|
|
||||||
console.log("REFETCH query: " + query_str);
|
console.log("[scheduleFeedUpdate] " + query_str);
|
||||||
|
|
||||||
new Ajax.Request("backend.php", {
|
new Ajax.Request("backend.php", {
|
||||||
parameters: query_str,
|
parameters: query_str,
|
||||||
|
|
Loading…
Reference in New Issue