From 060f43184db4cb6cdb75dda51e88f04c772e5c1e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Blin?=
 <sebastien.blin@savoirfairelinux.com>
Date: Mon, 4 Jun 2018 14:16:16 -0400
Subject: [PATCH] conversationsview: homogenize temporary item between Gnome
 and MacOSX

When querying a name in the search bar, we should see:
"Searching..." or "Not found" and the registered name below. Or,
actually, the registered name is not shown for the temporary item.
So, fix patch update the renderer to reflect that.

Change-Id: Idc0061300024820af7fed9fe9eaa45748bf03d0a
Reviewed-by: Hugo Lefeuvre <hugo.lefeuvre@savoirfairelinux.com>
---
 src/conversationsview.cpp | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/conversationsview.cpp b/src/conversationsview.cpp
index 9fae1ce2..298f0cc7 100644
--- a/src/conversationsview.cpp
+++ b/src/conversationsview.cpp
@@ -158,22 +158,21 @@ render_name_and_last_interaction(G_GNUC_UNUSED GtkTreeViewColumn *tree_column,
             bestId
         );
     } else if (std::string(alias).empty()) {
-        // For conversations with contacts with no alias
+        // If no alias to show, use the best id
         text = g_markup_printf_escaped(
             "<span font_weight=\"bold\">%s</span>\n<span size=\"smaller\" color=\"#666\">%s</span>",
             bestId,
             lastInteraction
         );
-    } else if (std::string(alias) == std::string(bestId)
-        || std::string(bestId).empty() || std::string(uid).empty()) {
-        // For temporary item
+    } else if (std::string(alias) == std::string(bestId)) {
+        // If the alias and the best id are identical, show only the alias
         text = g_markup_printf_escaped(
             "<span font_weight=\"bold\">%s</span>\n<span size=\"smaller\" color=\"#666\">%s</span>",
             alias,
             lastInteraction
         );
     } else {
-        // For conversations with contacts with alias
+        // If the alias is not empty and not equals to the best id, show both the alias and the best id
         text = g_markup_printf_escaped(
             "<span font_weight=\"bold\">%s</span>\n<span size=\"smaller\" color=\"#666\">%s</span>\n<span size=\"smaller\" color=\"#666\">%s</span>",
             alias,
-- 
GitLab