[Svn] r4022 - in trunk/roundcubemail: . program/steps/mail

trac at roundcube.net trac at roundcube.net
Thu Sep 30 10:30:46 CEST 2010


Author: alec
Date: 2010-09-30 03:30:46 -0500 (Thu, 30 Sep 2010)
New Revision: 4022

Modified:
   trunk/roundcubemail/CHANGELOG
   trunk/roundcubemail/program/steps/mail/compose.inc
Log:
- Change reply prefix to display email address only if sender name doesn't exist (#1486550)


Modified: trunk/roundcubemail/CHANGELOG
===================================================================
--- trunk/roundcubemail/CHANGELOG	2010-09-30 07:28:51 UTC (rev 4021)
+++ trunk/roundcubemail/CHANGELOG	2010-09-30 08:30:46 UTC (rev 4022)
@@ -10,6 +10,7 @@
 - Use custom sorting when SORT is disabled by IMAP admin (#1486959)
 - Allow setting some washtml options from plugin (#1486578)
 - Add option do bind for an individual LDAP address book (#1486997)
+- Change reply prefix to display email address only if sender name doesn't exist (#1486550)
 
 RELEASE 0.4.1
 -------------

Modified: trunk/roundcubemail/program/steps/mail/compose.inc
===================================================================
--- trunk/roundcubemail/program/steps/mail/compose.inc	2010-09-30 07:28:51 UTC (rev 4021)
+++ trunk/roundcubemail/program/steps/mail/compose.inc	2010-09-30 08:30:46 UTC (rev 4022)
@@ -624,9 +624,14 @@
 {
   global $RCMAIL, $MESSAGE, $LINE_LENGTH;
 
+  // build reply prefix
+  $from = array_pop($RCMAIL->imap->decode_address_list($MESSAGE->get_header('from')));
+  $prefix = sprintf("On %s, %s wrote:",
+    $MESSAGE->headers->date, $from['name'] ? $from['name'] : idn_to_utf8($from['email']));
+
   if (!$bodyIsHtml) {
     $body = preg_replace('/\r?\n/', "\n", $body);
-  
+
     // try to remove the signature
     if ($RCMAIL->config->get('strip_existing_sig', true)) {
       $len = strlen($body);
@@ -644,13 +649,9 @@
     // soft-wrap and quote message text
     $body = rcmail_wrap_and_quote(rtrim($body, "\n"), $LINE_LENGTH);
 
-    // add title line(s)
-    $prefix = sprintf("On %s, %s wrote:\n",
-      $MESSAGE->headers->date,
-      $MESSAGE->get_header('from'));
-
+    $prefix .= "\n";
     $suffix = '';
-    
+
     if ($RCMAIL->config->get('top_posting'))
       $prefix = "\n\n\n" . $prefix;
   }
@@ -663,9 +664,7 @@
     $body = rcmail_wash_html($body, array('safe' => $MESSAGE->is_safe), $cid_map);
 
     // build reply (quote content)
-    $prefix = sprintf("<p>On %s, %s wrote:</p>\n",
-      $MESSAGE->headers->date,
-      htmlspecialchars(Q($MESSAGE->get_header('from'), 'replace'), ENT_COMPAT, $RCMAIL->output->get_charset()));
+    $prefix = '<p>' . Q($prefix) . "</p>\n";
     $prefix .= '<blockquote>';
 
     if ($RCMAIL->config->get('top_posting')) {

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list