From bc4960108e78b8a571745f55f54c83ea34fd0336 Mon Sep 17 00:00:00 2001 From: thomascube Date: Fri, 9 Apr 2010 15:12:40 +0000 Subject: Option not to mark messages as read when viewed in preview pane (#1485012) --- program/steps/mail/compose.inc | 4 ++++ program/steps/mail/func.inc | 4 +++- program/steps/mail/show.inc | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) (limited to 'program/steps/mail') diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc index 658f59037..2fac294af 100644 --- a/program/steps/mail/compose.inc +++ b/program/steps/mail/compose.inc @@ -143,6 +143,10 @@ if (!empty($msg_uid)) $CONFIG['prefer_html'] = $CONFIG['prefer_html'] || $CONFIG['htmleditor'] || $compose_mode == RCUBE_COMPOSE_DRAFT || $compose_mode == RCUBE_COMPOSE_EDIT; $MESSAGE = new rcube_message($msg_uid); + // make sure message is marked as read + if ($MESSAGE && $MESSAGE->headers && !$MESSAGE->headers->seen) + $IMAP->set_flag($msg_uid, 'SEEN'); + if (!empty($MESSAGE->headers->charset)) $IMAP->set_charset($MESSAGE->headers->charset); diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc index 93a595602..7f67b2974 100644 --- a/program/steps/mail/func.inc +++ b/program/steps/mail/func.inc @@ -121,7 +121,9 @@ if (empty($RCMAIL->action) || $RCMAIL->action == 'list') $OUTPUT->set_env('skip_deleted', true); if ($CONFIG['display_next']) $OUTPUT->set_env('display_next', true); - + + $OUTPUT->set_env('preview_pane_mark_read', $RCMAIL->config->get('preview_pane_mark_read', 0)); + if ($CONFIG['trash_mbox']) $OUTPUT->set_env('trash_mailbox', $CONFIG['trash_mbox']); if ($CONFIG['drafts_mbox']) diff --git a/program/steps/mail/show.inc b/program/steps/mail/show.inc index 02e1f4824..10de46a36 100644 --- a/program/steps/mail/show.inc +++ b/program/steps/mail/show.inc @@ -140,7 +140,7 @@ if ($_GET['_uid']) { $OUTPUT->set_env('last_uid', $last); } - if (!$MESSAGE->headers->seen) + if (!$MESSAGE->headers->seen && ($RCMAIL->action == 'show' || ($RCMAIL->action == 'preview' && intval($CONFIG['preview_pane_mark_read']) == 0))) $RCMAIL->plugins->exec_hook('message_read', array('uid' => $MESSAGE->uid, 'mailbox' => $mbox_name, 'message' => $MESSAGE)); } @@ -226,7 +226,7 @@ else // mark message as read -if ($MESSAGE && $MESSAGE->headers && !$MESSAGE->headers->seen) +if ($MESSAGE && $MESSAGE->headers && !$MESSAGE->headers->seen && ($RCMAIL->action == 'show' || ($RCMAIL->action == 'preview' && intval($CONFIG['preview_pane_mark_read']) == 0))) $IMAP->set_flag($MESSAGE->uid, 'SEEN'); exit; -- cgit v1.2.3