From 3f5cef86665d068478fe7298f8b811e4de47b605 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Sun, 13 Apr 2008 05:15:39 -0400
Subject: [PATCH] - reverted r1295 - disable caching for unseen messages to allow marking as read remarked messages

---
 program/include/rcube_shared.inc |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/program/include/rcube_shared.inc b/program/include/rcube_shared.inc
index c9cf4fb..f3ff0aa 100644
--- a/program/include/rcube_shared.inc
+++ b/program/include/rcube_shared.inc
@@ -236,18 +236,22 @@
  * @param int Modified date as unix timestamp
  * @param string Etag value for caching
  */
-function send_modified_header($mdate, $etag=null)
+function send_modified_header($mdate, $etag=null, $skip_check=false)
 {
   if (headers_sent())
     return;
     
   $iscached = false;
-  if ($_SERVER['HTTP_IF_MODIFIED_SINCE'] && strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) >= $mdate)
-    $iscached = true;
-  
   $etag = $etag ? "\"$etag\"" : null;
-  if ($etag)
-    $iscached = ($_SERVER['HTTP_IF_NONE_MATCH'] == $etag);
+
+  if (!$skip_check)
+  {
+    if ($_SERVER['HTTP_IF_MODIFIED_SINCE'] && strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) >= $mdate)
+      $iscached = true;
+  
+    if ($etag)
+      $iscached = ($_SERVER['HTTP_IF_NONE_MATCH'] == $etag);
+  }
   
   if ($iscached)
     header("HTTP/1.x 304 Not Modified");

--
Gitblit v1.9.1