thomascube
2011-08-18 fbe54043cf598b19a753dc2b21a7ed558d23fd15
program/steps/mail/show.inc
@@ -5,7 +5,7 @@
 | program/steps/mail/show.inc                                           |
 |                                                                       |
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2005-2009, Roundcube Dev. - Switzerland                 |
 | Copyright (C) 2005-2009, The Roundcube Dev Team                       |
 | Licensed under the GNU GPL                                            |
 |                                                                       |
 | PURPOSE:                                                              |
@@ -64,6 +64,8 @@
    $OUTPUT->set_env('display_next', true);
  if ($MESSAGE->headers->others['list-post'])
    $OUTPUT->set_env('list_post', true);
  if ($CONFIG['forward_attachment'])
    $OUTPUT->set_env('forward_attachment', true);
  if (!$OUTPUT->ajax_call)
    $OUTPUT->add_label('checkingmail', 'deletemessage', 'movemessagetotrash',
@@ -196,8 +198,11 @@
if ($MESSAGE && $MESSAGE->headers && !$MESSAGE->headers->seen &&
  ($RCMAIL->action == 'show' || ($RCMAIL->action == 'preview' && intval($CONFIG['preview_pane_mark_read']) == 0)))
{
  if ($IMAP->set_flag($MESSAGE->uid, 'SEEN') && $_SESSION['unseen_count'][$mbox_name])
    $_SESSION['unseen_count'][$mbox_name] -= 1;
  if ($IMAP->set_flag($MESSAGE->uid, 'SEEN')) {
    if ($count = rcmail_get_unseen_count($mbox_name)) {
      rcmail_set_unseen_count($mbox_name, $count - 1);
    }
  }
}
exit;