From 5b40696ea0a0ca7dfc1d8702745df17c9662a3e5 Mon Sep 17 00:00:00 2001 From: James Booth Date: Tue, 19 Aug 2014 21:22:43 +0100 Subject: Handle chat states for users not in roster issue #397 --- configure-debug | 2 +- src/ui/console.c | 10 +++++++--- src/ui/core.c | 10 +++++++--- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/configure-debug b/configure-debug index 9819cfeb..85bfd817 100755 --- a/configure-debug +++ b/configure-debug @@ -1,3 +1,3 @@ #!/bin/sh -./configure CFLAGS='-g -O0' CXXFLAGS='-g -O0' +./configure CFLAGS='-g3 -O0' CXXFLAGS='-g3 -O0' diff --git a/src/ui/console.c b/src/ui/console.c index ebd876bd..3fd1caac 100644 --- a/src/ui/console.c +++ b/src/ui/console.c @@ -135,10 +135,14 @@ static void _cons_show_typing(const char * const barejid) { ProfWin *console = wins_get_console(); - PContact contact = roster_get_contact(barejid); const char * display_usr = NULL; - if (p_contact_name(contact) != NULL) { - display_usr = p_contact_name(contact); + PContact contact = roster_get_contact(barejid); + if (contact != NULL) { + if (p_contact_name(contact) != NULL) { + display_usr = p_contact_name(contact); + } else { + display_usr = barejid; + } } else { display_usr = barejid; } diff --git a/src/ui/core.c b/src/ui/core.c index 580f8691..6c3ed470 100644 --- a/src/ui/core.c +++ b/src/ui/core.c @@ -1258,10 +1258,14 @@ _ui_recipient_gone(const char * const barejid) if (barejid == NULL) return; - PContact contact = roster_get_contact(barejid); const char * display_usr = NULL; - if (p_contact_name(contact) != NULL) { - display_usr = p_contact_name(contact); + PContact contact = roster_get_contact(barejid); + if (contact != NULL) { + if (p_contact_name(contact) != NULL) { + display_usr = p_contact_name(contact); + } else { + display_usr = barejid; + } } else { display_usr = barejid; } -- cgit 1.4.1-2-gfad0