summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
Diffstat (limited to 'program')
-rw-r--r--program/include/rcube_shared.inc8
-rw-r--r--program/js/app.js12
-rw-r--r--program/steps/mail/show.inc4
3 files changed, 18 insertions, 6 deletions
diff --git a/program/include/rcube_shared.inc b/program/include/rcube_shared.inc
index 7a0fd059d..2ac3f3c41 100644
--- a/program/include/rcube_shared.inc
+++ b/program/include/rcube_shared.inc
@@ -1218,8 +1218,12 @@ function send_nocacheing_headers()
// send header with expire date 30 days in future
function send_future_expire_header()
{
- if (!headers_sent())
- header("Expires: ".gmdate("D, d M Y H:i:s", mktime()+2600000)." GMT");
+ if (headers_sent())
+ return;
+
+ header("Expires: ".gmdate("D, d M Y H:i:s", mktime()+2600000)." GMT");
+ header("Cache-Control: ");
+ header("Pragma: ");
}
diff --git a/program/js/app.js b/program/js/app.js
index 497598016..d47f4278e 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -157,6 +157,7 @@ function rcube_webmail()
{
this.enable_command('compose', 'add-contact', false);
parent.rcmail.show_messageframe(true);
+ parent.rcmail.mark_message('read', this.uid);
}
if ((this.env.action=='show' || this.env.action=='preview') && this.env.blockedobjects)
@@ -298,9 +299,9 @@ function rcube_webmail()
// start interval for keep-alive/recent_check signal
this.start_keepalive = function()
{
- if (this.env.keep_alive && this.task=='mail' && this.gui_objects.messagelist)
+ if (this.env.keep_alive && !this.env.framed && this.task=='mail' && this.gui_objects.messagelist)
this._int = setInterval(this.ref+'.check_for_recent()', this.env.keep_alive * 1000);
- else if (this.env.keep_alive && this.task!='login')
+ else if (this.env.keep_alive && !this.env.framed && this.task!='login')
this._int = setInterval(this.ref+'.send_keep_alive()', this.env.keep_alive * 1000);
}
@@ -1434,9 +1435,14 @@ function rcube_webmail()
for (var n=0; n<selection.length; n++)
{
id = selection[n];
- a_uids[a_uids.length] = id;
+ if ((flag=='read' && this.message_list.rows[id].unread) || (flag=='unread' && !this.message_list.rows[id].unread))
+ a_uids[a_uids.length] = id;
}
}
+
+ // nothing to do
+ if (!a_uids.length)
+ return;
switch (flag)
{
diff --git a/program/steps/mail/show.inc b/program/steps/mail/show.inc
index 8e6c3cd36..fd82345bb 100644
--- a/program/steps/mail/show.inc
+++ b/program/steps/mail/show.inc
@@ -23,6 +23,8 @@ require_once('Mail/mimeDecode.php');
$PRINT_MODE = $_action=='print' ? TRUE : FALSE;
+// allow this request to be cached
+send_future_expire_header();
// similar code as in program/steps/mail/get.inc
if ($_GET['_uid'])
@@ -58,7 +60,7 @@ if ($_GET['_uid'])
// mark message as read
- if (!$MESSAGE['headers']->seen)
+ if (!$MESSAGE['headers']->seen && $_action != 'preview')
$IMAP->set_flag($_GET['_uid'], 'SEEN');
// give message uid to the client