| | |
| | | | 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: | |
| | |
| | | $OUTPUT->set_env('delimiter', $IMAP->get_hierarchy_delimiter()); |
| | | $OUTPUT->set_env('mailbox', $mbox_name); |
| | | |
| | | // mimetypes supported by the browser (default settings) |
| | | $mimetypes = $RCMAIL->config->get('client_mimetypes', 'text/plain,text/html,text/xml,image/jpeg,image/gif,image/png,application/x-javascript,application/pdf,application/x-shockwave-flash'); |
| | | $OUTPUT->set_env('mimetypes', is_string($mimetypes) ? explode(',', $mimetypes) : (array)$mimetypes); |
| | | |
| | | if ($CONFIG['trash_mbox']) |
| | | $OUTPUT->set_env('trash_mailbox', $CONFIG['trash_mbox']); |
| | | if ($CONFIG['flag_for_deletion']) |
| | |
| | | $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', |
| | | 'movingmessage', 'deletingmessage'); |
| | | |
| | | // check for unset disposition notification |
| | | if ($MESSAGE->headers->mdn_to && |
| | | !$MESSAGE->headers->mdn_sent && !$MESSAGE->headers->seen && |
| | | ($IMAP->check_permflag('MDNSENT') || $IMAP->check_permflag('*')) && |
| | | $mbox_name != $CONFIG['drafts_mbox'] && |
| | | $mbox_name != $CONFIG['sent_mbox']) |
| | | { |
| | | if ($MESSAGE->headers->mdn_to |
| | | && empty($MESSAGE->headers->flags['MDNSENT']) |
| | | && empty($MESSAGE->headers->flags['SEEN']) |
| | | && ($IMAP->check_permflag('MDNSENT') || $IMAP->check_permflag('*')) |
| | | && $mbox_name != $CONFIG['drafts_mbox'] |
| | | && $mbox_name != $CONFIG['sent_mbox'] |
| | | ) { |
| | | $mdn_cfg = intval($CONFIG['mdn_requests']); |
| | | |
| | | if ($mdn_cfg == 1 || (($mdn_cfg == 3 || $mdn_cfg == 4) && rcmail_contact_exists($MESSAGE->sender['mailto']))) { |
| | |
| | | } |
| | | } |
| | | |
| | | if (!$MESSAGE->headers->seen && ($RCMAIL->action == 'show' || ($RCMAIL->action == 'preview' && intval($CONFIG['preview_pane_mark_read']) == 0))) |
| | | if (empty($MESSAGE->headers->flags['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)); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | |
| | | // mark message as read |
| | | if ($MESSAGE && $MESSAGE->headers && !$MESSAGE->headers->seen && |
| | | if ($MESSAGE && $MESSAGE->headers && empty($MESSAGE->headers->flags['SEEN']) && |
| | | ($RCMAIL->action == 'show' || ($RCMAIL->action == 'preview' && intval($CONFIG['preview_pane_mark_read']) == 0))) |
| | | { |
| | | if ($IMAP->set_flag($MESSAGE->uid, 'SEEN')) { |