From a06d0e5a8b92a2015a05b376eb6b8f4a9878c4e0 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 17 Jan 2009 16:01:09 +0100 Subject: [PATCH] rpc tweaks; viewfeed counters attachment changed --- backend.php | 9 +++------ feedlist.js | 3 ++- modules/backend-rpc.php | 28 ++++++++++++++-------------- 3 files changed, 19 insertions(+), 21 deletions(-) diff --git a/backend.php b/backend.php index d26461b4f..67f254a19 100644 --- a/backend.php +++ b/backend.php @@ -337,11 +337,6 @@ if ($_GET["debug"]) $timing_info = print_checkpoint("20", $timing_info); - $viewfeed_ctr_interval = 300; - - if ($csync || $_SESSION["bw_limit"]) { - $viewfeed_ctr_interval = 60; - } // if (get_pref($link, "SYNC_COUNTERS") || // time() - $_SESSION["get_all_counters_stamp"] > $viewfeed_ctr_interval) { @@ -350,11 +345,13 @@ // print ""; // } - if (get_pref($link, 'COMBINED_DISPLAY_MODE') || $subop) { + if (get_pref($link, 'COMBINED_DISPLAY_MODE') || $subop || + time() - $_SESSION["viewfeed:counters_stamp"] > 30) { if (!$offset) { print ""; getAllCounters($link, $omode, $feed); print ""; + $_SESSION["viewfeed:counters_stamp"] = time(); } } diff --git a/feedlist.js b/feedlist.js index 06fea27c7..68c93e4c5 100644 --- a/feedlist.js +++ b/feedlist.js @@ -394,7 +394,8 @@ function feedlist_init() { document.onmousemove = mouse_move_handler; document.onmousedown = mouse_down_handler; document.onmouseup = mouse_up_handler; - setTimeout("timeout()", 0); + + setTimeout("timeout()", 1); if (typeof correctPNG != 'undefined') { correctPNG(); diff --git a/modules/backend-rpc.php b/modules/backend-rpc.php index 41e8ebd18..4d65ee23e 100644 --- a/modules/backend-rpc.php +++ b/modules/backend-rpc.php @@ -142,26 +142,26 @@ print ""; - $omode = $_GET["omode"]; + if ($global_unread_caller != $global_unread) { + + $omode = $_GET["omode"]; - if (!$omode) $omode = "tflc"; + if (!$omode) $omode = "tflc"; - if (strchr($omode, "l")) getLabelCounters($link); + if (strchr($omode, "l")) getLabelCounters($link); - if (strchr($omode, "c")) { - if (get_pref($link, 'ENABLE_FEED_CATS')) { - getCategoryCounters($link); - } - } - - if ($global_unread_caller != $global_unread) { + if (strchr($omode, "c")) { + if (get_pref($link, 'ENABLE_FEED_CATS')) { + getCategoryCounters($link); + } + } if (strchr($omode, "f")) getFeedCounters($link); - if (strchr($omode, "t")) getTagCounters($link); - } - - getGlobalCounters($link, $global_unread); + if (strchr($omode, "t")) getTagCounters($link); + getGlobalCounters($link, $global_unread); + } + print ""; print_runtime_info($link);