about summary refs log tree commit diff stats
path: root/src/contact.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-01-05 00:38:45 +0000
committerJames Booth <boothj5@gmail.com>2014-01-05 00:38:45 +0000
commit9da4a6e1b9f13b253de3d029ef5cfb31a7109fa8 (patch)
tree6d12acbd40bc8e9e3f7293b7b0d8538146749397 /src/contact.c
parentd15751649c5bc18f61d13b9db35a385cf7077538 (diff)
downloadprofani-tty-9da4a6e1b9f13b253de3d029ef5cfb31a7109fa8.tar.gz
Refactored contact display string
Diffstat (limited to 'src/contact.c')
-rw-r--r--src/contact.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/contact.c b/src/contact.c
index 0b955548..b2bef275 100644
--- a/src/contact.c
+++ b/src/contact.c
@@ -171,12 +171,9 @@ p_contact_create_display_string(const PContact contact, const char * const resou
 {
     GString *result_str = g_string_new("");
 
-    // use nickname if exists
-    if (contact->name != NULL) {
-        g_string_append(result_str, contact->name);
-    } else {
-        g_string_append(result_str, contact->barejid);
-    }
+    // use nickname if exists                                                         
+    const char *display_name = p_contact_name_or_jid(contact);                   
+    g_string_append(result_str, display_name);   
 
     // add resource if not default provided by profanity
     if (strcmp(resource, "__prof_default") != 0) {