Changeset b620493a in github


Ignore:
Timestamp:
Feb 5, 2010 6:35:11 AM (3 years ago)
Author:
alecpl <alec@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
f6b145d
Parents:
ad18d63
Message:
  • Fix quoted text wrapping when replying to an HTML email in plain text (#1484141)
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • CHANGELOG

    rad18d63 rb620493a  
    22=========================== 
    33 
     4- Fix quoted text wrapping when replying to an HTML email in plain text (#1484141) 
    45- Fix handling of extended mailto links (with params) (#1486354) 
    56- Fix sorting by date of messages without date header on servers without SORT (#1486286) 
  • program/steps/mail/compose.inc

    r9e63e28 rb620493a  
    129129  $OUTPUT->set_env('show_sig', false); 
    130130 
     131// set line length for body wrapping 
     132$LINE_LENGTH = $RCMAIL->config->get('line_length', 75); 
     133 
    131134if (!empty($msg_uid)) 
    132135{ 
    133136  // similar as in program/steps/mail/show.inc 
    134137  // re-set 'prefer_html' to have possibility to use html part for compose 
    135   $CONFIG['prefer_html'] = $CONFIG['htmleditor'] || $compose_mode == RCUBE_COMPOSE_DRAFT || $compose_mode == RCUBE_COMPOSE_EDIT; 
     138  $CONFIG['prefer_html'] = $CONFIG['prefer_html'] || $CONFIG['htmleditor'] || $compose_mode == RCUBE_COMPOSE_DRAFT || $compose_mode == RCUBE_COMPOSE_EDIT; 
    136139  $MESSAGE = new rcube_message($msg_uid); 
    137140   
     
    396399function rcmail_compose_body($attrib) 
    397400{ 
    398   global $RCMAIL, $CONFIG, $OUTPUT, $MESSAGE, $compose_mode; 
     401  global $RCMAIL, $CONFIG, $OUTPUT, $MESSAGE, $compose_mode, $LINE_LENGTH; 
    399402   
    400403  list($form_start, $form_end) = get_form_tags($attrib); 
     
    425428  else if ($compose_mode) 
    426429  { 
    427     if (($isHtml || $compose_mode == RCUBE_COMPOSE_DRAFT) && $MESSAGE->has_html_part()) 
     430    $has_html_part = $MESSAGE->has_html_part(); 
     431    if (($isHtml || $compose_mode == RCUBE_COMPOSE_DRAFT) && $has_html_part) 
    428432    { 
    429433      $body = $MESSAGE->first_html_part(); 
    430434      $isHtml = true; 
     435    } 
     436    else if ($has_html_part) 
     437    { 
     438      // use html part if it has been used for message (pre)viewing 
     439      // decrease line length for quoting 
     440      $len = $compose_mode == RCUBE_COMPOSE_REPLY ? $LINE_LENGTH-2 : $LINE_LENGTH; 
     441      $txt = new html2text($MESSAGE->first_html_part(), false, true, $len); 
     442      $body = $txt->get_text(); 
     443      $isHtml = false; 
    431444    } 
    432445    else 
     
    523536function rcmail_create_reply_body($body, $bodyIsHtml) 
    524537{ 
    525   global $RCMAIL, $MESSAGE; 
     538  global $RCMAIL, $MESSAGE, $LINE_LENGTH; 
    526539 
    527540  if (!$bodyIsHtml) { 
     
    533546 
    534547    // soft-wrap message first 
    535     $body = rcmail_wrap_quoted($body, 75); 
     548    $body = rcmail_wrap_quoted($body, $LINE_LENGTH); 
    536549 
    537550    $body = rtrim($body, "\r\n"); 
     
    555568    $prefix = rc_wordwrap(sprintf("On %s, %s wrote:\n", 
    556569      $MESSAGE->headers->date, 
    557       $MESSAGE->get_header('from')), 76); 
     570      $MESSAGE->get_header('from')), $LINE_LENGTH); 
    558571 
    559572    $suffix = ''; 
  • program/steps/mail/sendmail.inc

    r10eedbe rb620493a  
    358358} 
    359359 
     360// set line length for body wrapping 
     361$LINE_LENGTH = $RCMAIL->config->get('line_length', 75); 
     362 
    360363// create extended PEAR::Mail_mime instance 
    361364$MAIL_MIME = new rcube_mail_mime($RCMAIL->config->header_delimiter()); 
     
    370373  // add a plain text version of the e-mail as an alternative part. 
    371374  $h2t = new html2text($plugin['body'], false, true, 0); 
    372   $plainTextPart = rc_wordwrap($h2t->get_text(), 75, "\r\n") . ($footer ? "\r\n".$footer : ''); 
     375  $plainTextPart = rc_wordwrap($h2t->get_text(), $LINE_LENGTH, "\r\n") . ($footer ? "\r\n".$footer : ''); 
    373376  $plainTextPart = wordwrap($plainTextPart, 998, "\r\n", true); 
    374377  if (!strlen($plainTextPart)) { 
     
    384387else 
    385388  { 
    386   $message_body = rc_wordwrap($message_body, 75, "\r\n"); 
     389  $message_body = rc_wordwrap($message_body, $LINE_LENGTH, "\r\n"); 
    387390  if ($footer) 
    388391    $message_body .= "\r\n" . $footer; 
Note: See TracChangeset for help on using the changeset viewer.