From e848180aaa9640de871796ca1a3e4f8110701fd6 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Thu, 12 May 2011 16:18:19 -0400
Subject: [PATCH] Improve display name composition when saving contacts (#1487143), with plugin-support; allow empty names in sql address book, fall back to e-mail address in listing and vcard export

---
 program/steps/mail/addcontact.inc |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/program/steps/mail/addcontact.inc b/program/steps/mail/addcontact.inc
index 03adcbe..0baf6cd 100644
--- a/program/steps/mail/addcontact.inc
+++ b/program/steps/mail/addcontact.inc
@@ -49,10 +49,7 @@
     }
 
     $contact['email'] = rcube_idn_to_utf8($contact['email']);
-
-    // use email address part for name
-    if (empty($contact['name']) || $contact['name'] == $contact['email'])
-      $contact['name'] = ucfirst(preg_replace('/[\.\-]/', ' ', substr($contact['email'], 0, strpos($contact['email'], '@'))));
+    $contact['name'] = rcube_addressbook::compose_display_name($contact);
 
     // check for existing contacts
     $existing = $CONTACTS->search('email', $contact['email'], true, false);

--
Gitblit v1.9.1