diff options
author | James Booth <boothj5@gmail.com> | 2014-08-19 21:22:43 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2014-08-19 21:22:43 +0100 |
commit | 5b40696ea0a0ca7dfc1d8702745df17c9662a3e5 (patch) | |
tree | d3e767ed75ee31d5e3eab09f54506d643cebb494 /src | |
parent | 78b870b5eca06b0b24cb913552648362a64c4531 (diff) | |
download | profani-tty-5b40696ea0a0ca7dfc1d8702745df17c9662a3e5.tar.gz |
Handle chat states for users not in roster
issue #397
Diffstat (limited to 'src')
-rw-r--r-- | src/ui/console.c | 10 | ||||
-rw-r--r-- | src/ui/core.c | 10 |
2 files changed, 14 insertions, 6 deletions
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; } |