From 7dfb1fba5001299300736e6b5d95d9400575e3e7 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Thu, 18 Sep 2008 14:59:02 -0400
Subject: [PATCH] Set the right number of arguments for setcookie()

---
 program/steps/mail/show.inc |   25 +++++++++++++++++++++----
 1 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/program/steps/mail/show.inc b/program/steps/mail/show.inc
index bff4e68..0b15c98 100644
--- a/program/steps/mail/show.inc
+++ b/program/steps/mail/show.inc
@@ -35,7 +35,7 @@
     if ($RCMAIL->action=='preview' && $OUTPUT->template_exists('messagepreview'))
         $OUTPUT->send('messagepreview');
     else {
-      $RCMAIL->action = 'list';
+      rcmail_overwrite_action('');
       return;
     }
   }
@@ -80,15 +80,21 @@
   $OUTPUT->set_env('uid', $MESSAGE->uid);
   $OUTPUT->set_env('safemode', $MESSAGE->is_safe);
   $OUTPUT->set_env('sender', $MESSAGE->sender['string']);
+  $OUTPUT->set_env('permaurl', rcmail_url('show', array('_uid' => $MESSAGE->uid, '_mbox' => $mbox_name)));
   
   // check for unset disposition notification
-  if ($MESSAGE->headers->mdn_to && !$MESSAGE->headers->mdn_sent &&
-      $mbox_name != $CONFIG['drafts_mbox'] && $mbox_name != $CONFIG['sent_mbox'])
+  if ($MESSAGE->headers->mdn_to &&
+      !$MESSAGE->headers->mdn_sent &&
+      $IMAP->check_permflag('MDNSENT') &&
+      $mbox_name != $CONFIG['drafts_mbox'] &&
+      $mbox_name != $CONFIG['sent_mbox'])
   {
     if (intval($CONFIG['mdn_requests']) === 1)
     {
       if (rcmail_send_mdn($MESSAGE->uid))
         $OUTPUT->show_message('receiptsent', 'confirmation');
+      else
+        $OUTPUT->show_message('errorsendingreceipt', 'error');
     }
     else if (empty($CONFIG['mdn_requests']))
     {
@@ -147,6 +153,15 @@
         $ol .= html::tag('li', null, sprintf("%s (%s)", Q($attach_prop->filename), Q(show_bytes($attach_prop->size))));
       }
       else {
+        if (rc_strlen($attach_prop->filename) > 50) {
+          $filename = abbreviate_string($attach_prop->filename, 50);
+          $title = $attach_prop->filename;
+      }
+      else {
+        $filename = $attach_prop->filename;
+        $title = '';
+      }
+
         $ol .= html::tag('li', null,
           html::a(array(
             'href' => $MESSAGE->get_part_url($attach_prop->mime_id),
@@ -155,8 +170,9 @@
               JS_OBJECT_NAME,
               $attach_prop->mime_id,
               $attach_prop->mimetype),
+              'title' => Q($title),
             ),
-            Q($attach_prop->filename)));
+            Q($filename)));
       }
     }
 
@@ -191,6 +207,7 @@
 
 $OUTPUT->add_handlers(array(
   'messageattachments' => 'rcmail_message_attachments',
+  'mailboxname' => 'rcmail_mailbox_name_display',
   'blockedobjects' => 'rcmail_remote_objects_msg'));
 
 

--
Gitblit v1.9.1