From f9a967763e2a4cc595b44f40ac1ca666b2a02af6 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Sat, 11 Feb 2012 06:28:58 -0500
Subject: [PATCH] User configurable setting how to display contact names in list

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

diff --git a/program/steps/mail/addcontact.inc b/program/steps/mail/addcontact.inc
index 8e11272..7476811 100644
--- a/program/steps/mail/addcontact.inc
+++ b/program/steps/mail/addcontact.inc
@@ -61,7 +61,10 @@
     }
 
     $contact['email'] = rcube_idn_to_utf8($contact['email']);
-    $contact['name'] = rcube_addressbook::compose_display_name($contact);
+    $contact = $RCMAIL->plugins->exec_hook('contact_displayname', $contact);
+
+    if (empty($contact['firstname']) || empty($contact['surname']))
+      $contact['name'] = rcube_addressbook::compose_display_name($contact);
 
     // validate contact record
     if (!$CONTACTS->validate($contact, true)) {

--
Gitblit v1.9.1