summaryrefslogtreecommitdiff
path: root/program/include/rcube_message.php
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2010-10-06 17:15:38 +0000
committeralecpl <alec@alec.pl>2010-10-06 17:15:38 +0000
commit868deb5dabdc4d63210e4f53a2a80a904247af6a (patch)
treee5391d3273ca70bc7a4727ccc8db4bcdc401c2c2 /program/include/rcube_message.php
parentace511a771656c983046919333cee501339c98a1 (diff)
- Make htmleditor option behaviour consistent, add option to use HTML on reply to HTML message (#1485840)
Diffstat (limited to 'program/include/rcube_message.php')
-rw-r--r--program/include/rcube_message.php17
1 files changed, 6 insertions, 11 deletions
diff --git a/program/include/rcube_message.php b/program/include/rcube_message.php
index 19f36b335..dfccb36e9 100644
--- a/program/include/rcube_message.php
+++ b/program/include/rcube_message.php
@@ -214,27 +214,21 @@ class rcube_message
/**
* Return the first text part of this message
*
+ * @param rcube_message_part $part Reference to the part if found
* @return string Plain text message/part content
*/
- function first_text_part()
+ function first_text_part(&$part=null)
{
// no message structure, return complete body
if (empty($this->parts))
return $this->body;
- $out = null;
-
// check all message parts
foreach ($this->mime_parts as $mime_id => $part) {
$mimetype = $part->ctype_primary . '/' . $part->ctype_secondary;
if ($mimetype == 'text/plain') {
- $out = $this->imap->get_message_part($this->uid, $mime_id, $part);
-
- // re-format format=flowed content
- if ($part->ctype_secondary == 'plain' && $part->ctype_parameters['format'] == 'flowed')
- $out = self::unfold_flowed($out);
- break;
+ return $this->imap->get_message_part($this->uid, $mime_id, $part);
}
else if ($mimetype == 'text/html') {
$out = $this->imap->get_message_part($this->uid, $mime_id, $part);
@@ -245,11 +239,12 @@ class rcube_message
// create instance of html2text class
$txt = new html2text($out);
- $out = $txt->get_text();
+ return $txt->get_text();
}
}
- return $out;
+ $part = null;
+ return null;
}