From 0bb674110e500be0d88baae8978323e490b7f9e7 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Wed, 10 Feb 2010 11:00:17 -0700 Subject: [PATCH] Fix display of duplicate attachments --- imp/lib/Ui/Message.php | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/imp/lib/Ui/Message.php b/imp/lib/Ui/Message.php index f2822ea9f..548abf365 100644 --- a/imp/lib/Ui/Message.php +++ b/imp/lib/Ui/Message.php @@ -491,13 +491,7 @@ class IMP_Ui_Message continue; } - if ($render_mode = $imp_contents->canDisplay($mime_id, IMP_Contents::RENDER_INLINE | IMP_Contents::RENDER_INFO)) { - if (($show_parts == 'atc') && - !($render_mode & IMP_Contents::RENDER_INLINE) && - $imp_contents->isAttachment($mime_type)) { - $atc_parts[] = $mime_id; - } - } else { + if (!($render_mode = $imp_contents->canDisplay($mime_id, IMP_Contents::RENDER_INLINE | IMP_Contents::RENDER_INFO))) { if ($imp_contents->isAttachment($mime_type)) { if ($show_parts == 'atc') { $atc_parts[] = $mime_id; @@ -509,14 +503,17 @@ class IMP_Ui_Message } $render_part = $imp_contents->renderMIMEPart($mime_id, $render_mode); + if (($show_parts == 'atc') && + $imp_contents->isAttachment($mime_type) && + (empty($render_part) || + !($render_mode & IMP_Contents::RENDER_INLINE))) { + $atc_parts[] = $mime_id; + } + if (empty($render_part)) { - /* This meant that nothing was rendered - allow this part to - * appear in the attachment list instead. */ - if ($show_parts == 'atc') { - $atc_parts[] = $mime_id; + if ($imp_contents->isAttachment($mime_type)) { + $msgtext .= $this->formatSummary($imp_contents->getSummary($mime_id, $contents_mask), $part_info_display, true); } - - $msgtext .= $this->formatSummary($imp_contents->getSummary($mime_id, $contents_mask), $part_info_display, true); continue; } -- 2.11.0