From 265e930461d215b5560aaf2d11c196a3e8a488b6 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Tue, 18 Nov 2008 15:38:57 -0700 Subject: [PATCH] Use features provided by other libs. --- imp/lib/Contents.php | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/imp/lib/Contents.php b/imp/lib/Contents.php index df91c6e1b..77d7272ca 100644 --- a/imp/lib/Contents.php +++ b/imp/lib/Contents.php @@ -111,7 +111,6 @@ class IMP_Contents ), array('ids' => array($this->_index))); $this->_message = $ret[$this->_index]['structure']; } catch (Horde_Imap_Client_Exception $e) { - $GLOBALS['imp_imap']->logException($e); return PEAR::raiseError('Error displaying message.'); } } @@ -154,7 +153,6 @@ class IMP_Contents ), array('ids' => array($this->_index))); return $res[$this->_index]['bodytext'][0]; } catch (Horde_Imap_Client_Exception $e) { - $GLOBALS['imp_imap']->logException($e); return ''; } } @@ -194,7 +192,6 @@ class IMP_Contents ? $res[$this->_index]['bodypart'][$id] : $res[$this->_index]['mimeheader'][$id] . $res[$this->_index]['bodypart'][$id]; } catch (Horde_Imap_Client_Exception $e) { - $GLOBALS['imp_imap']->logException($e); return ''; } } @@ -217,7 +214,6 @@ class IMP_Contents ), array('ids' => array($this->_index))); return $res[$this->_index]['headertext'][0] . $res[$this->_index]['bodytext'][0]; } catch (Horde_Imap_Client_Exception $e) { - $GLOBALS['imp_imap']->logException($e); return ''; } } @@ -239,7 +235,6 @@ class IMP_Contents ), array('ids' => array($this->_index))); return $res[$this->_index]['headertext'][0]; } catch (Horde_Imap_Client_Exception $e) { - $GLOBALS['imp_imap']->logException($e); return new Horde_Mime_Headers(); } } @@ -384,15 +379,8 @@ class IMP_Contents */ public function findBody($subtype = null) { - foreach ($this->getContentTypeMap() as $mime_id => $mime_type) { - if ((strpos($mime_type, 'text/') === 0) && - (intval($mime_id) == 1) && - (is_null($subtype) || (substr($mime_type, 5) == $subtype))) { - return $mime_id; - } - } - - return null; + $this->_buildMessage(); + return $this->_message->findBody($subtype); } /** -- 2.11.0