summaryrefslogtreecommitdiff
path: root/roundcubemail/program/include/rcube_message.php
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-10-06 17:15:38 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-10-06 17:15:38 +0000
commit79f7e4878e8a90bac291f15b0c44d8f5819744cb (patch)
tree90b4d4dd60afb0b01f022d8cb6c94a8bf821349f /roundcubemail/program/include/rcube_message.php
parent058cac7b020c1fff4985cf92316c40002d4e5fe9 (diff)
- Make htmleditor option behaviour consistent, add option to use HTML on reply to HTML message (#1485840)
git-svn-id: https://svn.roundcube.net/trunk@4054 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include/rcube_message.php')
-rw-r--r--roundcubemail/program/include/rcube_message.php17
1 files changed, 6 insertions, 11 deletions
diff --git a/roundcubemail/program/include/rcube_message.php b/roundcubemail/program/include/rcube_message.php
index 19f36b335..dfccb36e9 100644
--- a/roundcubemail/program/include/rcube_message.php
+++ b/roundcubemail/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;
}