From ea7ce48914dc159990d4ef586499a61a7a2dffef Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Thu, 2 May 2013 20:45:52 +0200 Subject: [PATCH] Contacts: Get display name from either FN, ORG or EMAIL. --- js/contacts.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/contacts.js b/js/contacts.js index dbdcd7bc..d746218b 100644 --- a/js/contacts.js +++ b/js/contacts.js @@ -37,7 +37,7 @@ OC.Contacts = OC.Contacts || {}; }; Contact.prototype.getDisplayName = function() { - return this.getPreferredValue('FN'); + return this.getPreferredValue('FN') || this.getPreferredValue('ORG') || this.getPreferredValue('EMAIL'); }; Contact.prototype.getId = function() { @@ -862,7 +862,7 @@ OC.Contacts = OC.Contacts || {}; id: this.id, parent: this.metadata.parent, backend: this.metadata.backend, - name: this.getPreferredValue('FN', ''), + name: this.getDisplayName(), email: this.getPreferredValue('EMAIL', ''), tel: this.getPreferredValue('TEL', ''), adr: this.getPreferredValue('ADR', []).clean('').join(', '),