Aleksander Machniak
2012-11-12 a38cd0f12a29ba323c1edaa7fbd1f51572454304
Fix excessive LFs at the end of composed message with top_posting=true (#1488797)

Conflicts:

CHANGELOG
4 files modified
17 ■■■■■ changed files
CHANGELOG 1 ●●●● patch | view | raw | blame | history
program/js/app.js 4 ●●●● patch | view | raw | blame | history
program/steps/mail/compose.inc 10 ●●●● patch | view | raw | blame | history
program/steps/mail/func.inc 2 ●●● patch | view | raw | blame | history
CHANGELOG
@@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail
===========================
- Fix excessive LFs at the end of composed message with top_posting=true (#1488797)
- Fix bug where leading blanks were stripped from quoted lines (#1488795)
RELEASE 0.8.3
program/js/app.js
@@ -3300,6 +3300,10 @@
            message = message.substring(0, p) + sig + message.substring(p, message.length);
            cursor_pos = p - 1;
          }
          else if (!message) { // empty message
            cursor_pos = 0;
            message = '\n\n' + sig;
          }
          else if (pos = this.get_caret_pos(input_message.get(0))) { // at cursor position
            message = message.substring(0, pos) + '\n' + sig + '\n\n' + message.substring(pos, message.length);
            cursor_pos = pos;
program/steps/mail/compose.inc
@@ -901,9 +901,10 @@
  if (!$bodyIsHtml) {
    $body = preg_replace('/\r?\n/', "\n", $body);
    $body = trim($body, "\n");
    // soft-wrap and quote message text
    $body = rcmail_wrap_and_quote(rtrim($body, "\n"), $LINE_LENGTH);
    $body = rcmail_wrap_and_quote($body, $LINE_LENGTH);
    $prefix .= "\n";
    $suffix = '';
@@ -947,8 +948,7 @@
  $date    = format_date($MESSAGE->headers->date, $RCMAIL->config->get('date_long'));
  $charset = $RCMAIL->output->get_charset();
  if (!$bodyIsHtml)
  {
  if (!$bodyIsHtml) {
    $prefix = "\n\n\n-------- " . rcube_label('originalmessage') . " --------\n";
    $prefix .= rcube_label('subject') . ': ' . $MESSAGE->subject . "\n";
    $prefix .= rcube_label('date')    . ': ' . $date . "\n";
@@ -961,9 +961,9 @@
      $prefix .= rcube_label('replyto') . ': ' . $MESSAGE->get_header('replyto') . "\n";
    $prefix .= "\n";
    $body = trim($body, "\r\n");
  }
  else
  {
  else {
    // set is_safe flag (we need this for html body washing)
    rcmail_check_safe($MESSAGE);
    // clean up html tags
program/steps/mail/func.inc
@@ -1499,7 +1499,7 @@
    $out .= $line . "\n";
  }
  return $out;
  return rtrim($out, "\n");
}