about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-12-21 22:39:00 +0000
committerJames Booth <boothj5@gmail.com>2014-12-21 22:39:00 +0000
commiteef7f9cfd4f74b03b6e3ecfe5ef496fbb4e238a8 (patch)
tree3966a0355da824805810e0efa6246b46bb086f86 /src
parent0c1bbb63c08e1237dd2a329b6c085fe5ced1f1d7 (diff)
downloadprofani-tty-eef7f9cfd4f74b03b6e3ecfe5ef496fbb4e238a8.tar.gz
Show nick for title
Diffstat (limited to 'src')
-rw-r--r--src/ui/window.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/ui/window.c b/src/ui/window.c
index 6a944c7a..76c923af 100644
--- a/src/ui/window.c
+++ b/src/ui/window.c
@@ -238,7 +238,13 @@ win_get_title(ProfWin *window)
     if (window->type == WIN_CHAT) {
         ProfChatWin *chatwin = (ProfChatWin*) window;
         assert(chatwin->memcheck == PROFCHATWIN_MEMCHECK);
-        return strdup(chatwin->barejid);
+        PContact contact = roster_get_contact(chatwin->barejid);
+        if (contact) {
+            const char *name = p_contact_name_or_jid(contact);
+            return strdup(name);
+        } else {
+            return strdup(chatwin->barejid);
+        }
     }
     if (window->type == WIN_MUC) {
         ProfMucWin *mucwin = (ProfMucWin*) window;