From 0d5618fdd1dd30d7594aa450d46ed91df43f8f24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sat, 1 Oct 2011 00:33:36 +0200 Subject: [PATCH] contact-display: Try harder to display a meaningful name We now match individuals on other properties than alias, so take this into account when representing a contact in search results to avoid having them show up as "Unknown". https://bugzilla.gnome.org/show_bug.cgi?id=660580 --- js/ui/contactDisplay.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/js/ui/contactDisplay.js b/js/ui/contactDisplay.js index 10048af68..8cc46e03f 100644 --- a/js/ui/contactDisplay.js +++ b/js/ui/contactDisplay.js @@ -26,7 +26,8 @@ function Contact(id) { Contact.prototype = { _init: function(id) { - this.individual = Shell.ContactSystem.get_default().get_individual(id); + this._contactSys = Shell.ContactSystem.get_default(); + this.individual = this._contactSys.get_individual(id); this.actor = new St.Bin({ style_class: 'contact', reactive: true, @@ -56,7 +57,12 @@ Contact.prototype = { x_align: St.Align.START, y_align: St.Align.MIDDLE }); - let aliasText = this.individual.alias || _("Unknown"); + let email = this._contactSys.get_email_for_display(this.individual); + let aliasText = this.individual.alias || + this.individual.full_name || + this.individual.nickname || + email || + _("Unknown"); let aliasLabel = new St.Label({ text: aliasText, style_class: 'contact-details-alias' }); details.add(aliasLabel, { x_fill: true,