summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2011-07-26 12:51:19 +0000
committeralecpl <alec@alec.pl>2011-07-26 12:51:19 +0000
commit79dd1692e3f109062e51cb5bb14ae67709276bf2 (patch)
tree7c29555f546803df237920a0563a1e77fc37ef44 /program
parent909a3acb83c66aafa545eb086921a422a69cfabe (diff)
- Another display name fix: don't store display name only if it equals to email address
Diffstat (limited to 'program')
-rw-r--r--program/steps/addressbook/save.inc9
1 files changed, 9 insertions, 0 deletions
diff --git a/program/steps/addressbook/save.inc b/program/steps/addressbook/save.inc
index 393eb5145..ef1b9f90d 100644
--- a/program/steps/addressbook/save.inc
+++ b/program/steps/addressbook/save.inc
@@ -164,6 +164,15 @@ if (isset($a_record['photo'])) {
$RCMAIL->session->remove('contacts');
}
+// Generate contact's display name
+if (empty($a_record['name'])) {
+ $a_record['name'] = rcube_addressbook::compose_display_name($a_record, true);
+ // Reset it if equals to email address (from compose_display_name())
+ if ($a_record['name'] == $a_record['email'][0])
+ $a_record['name'] = '';
+}
+
+
// update an existing contact
if (!empty($cid))
{