From 62b4fd490e281635ce5ebed086df54875695a724 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Mon, 2 Nov 2009 10:59:53 -0700 Subject: [PATCH] Only show empty message if this is an attachment --- imp/lib/Contents.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/imp/lib/Contents.php b/imp/lib/Contents.php index 806d762e9..b7666fda3 100644 --- a/imp/lib/Contents.php +++ b/imp/lib/Contents.php @@ -390,7 +390,11 @@ class IMP_Contents $mime_part = empty($options['mime_part']) ? $this->getMIMEPart($mime_id) : $options['mime_part']; - $viewer = Horde_Mime_Viewer::factory($mime_part, empty($options['type']) ? null : $options['type']); + $type = empty($options['type']) + ? $mime_part->getType() + : $options['type']; + + $viewer = Horde_Mime_Viewer::factory($mime_part, $type); $viewer->setParams(array('contents' => $this)); if (!empty($options['params'])) { $viewer->setParams($options['params']); @@ -442,7 +446,9 @@ class IMP_Contents $ret[$mime_id]['name'] = $mime_part->getName(true); } - if (($textmode == 'inline') && !strlen($ret[$mime_id]['data'])) { + if (($textmode == 'inline') && + !strlen($ret[$mime_id]['data']) && + $this->isAttachment($type)) { if (empty($ret[$mime_id]['status'])) { $ret[$mime_id]['status'] = array( array( -- 2.11.0