diff --git a/src/profanity.c b/src/profanity.c index 0c5477af..4d7bc397 100644 --- a/src/profanity.c +++ b/src/profanity.c @@ -157,7 +157,7 @@ prof_handle_contact_online(char *contact, char *show, char *status) void prof_handle_contact_offline(char *contact, char *show, char *status) { - gboolean result = contact_list_remove(contact); + gboolean result = contact_list_add(contact, "offline", status); if (result) { win_contact_offline(contact, show, status); } diff --git a/src/windows.c b/src/windows.c index 6bdc17d1..fca84286 100644 --- a/src/windows.c +++ b/src/windows.c @@ -563,43 +563,46 @@ cons_show_online_contacts(GSList *list) while(curr) { PContact contact = curr->data; - _win_show_time(_cons_win); const char *show = p_contact_show(contact); + + if (strcmp(show, "offline") != 0) { + _win_show_time(_cons_win); - if (strcmp(show, "online") == 0) { - wattron(_cons_win, COLOUR_ONLINE); - } else if (strcmp(show, "away") == 0) { - wattron(_cons_win, COLOUR_AWAY); - } else if (strcmp(show, "chat") == 0) { - wattron(_cons_win, COLOUR_CHAT); - } else if (strcmp(show, "dnd") == 0) { - wattron(_cons_win, COLOUR_DND); - } else if (strcmp(show, "xa") == 0) { - wattron(_cons_win, COLOUR_XA); - } else { - wattron(_cons_win, COLOUR_OFFLINE); - } + if (strcmp(show, "online") == 0) { + wattron(_cons_win, COLOUR_ONLINE); + } else if (strcmp(show, "away") == 0) { + wattron(_cons_win, COLOUR_AWAY); + } else if (strcmp(show, "chat") == 0) { + wattron(_cons_win, COLOUR_CHAT); + } else if (strcmp(show, "dnd") == 0) { + wattron(_cons_win, COLOUR_DND); + } else if (strcmp(show, "xa") == 0) { + wattron(_cons_win, COLOUR_XA); + } else { + wattron(_cons_win, COLOUR_OFFLINE); + } - wprintw(_cons_win, "%s", p_contact_name(contact)); - wprintw(_cons_win, " is %s", show); - - if (p_contact_status(contact)) - wprintw(_cons_win, ", \"%s\"", p_contact_status(contact)); - - wprintw(_cons_win, "\n"); + wprintw(_cons_win, "%s", p_contact_name(contact)); + wprintw(_cons_win, " is %s", show); + + if (p_contact_status(contact)) + wprintw(_cons_win, ", \"%s\"", p_contact_status(contact)); + + wprintw(_cons_win, "\n"); - if (strcmp(show, "online") == 0) { - wattroff(_cons_win, COLOUR_ONLINE); - } else if (strcmp(show, "away") == 0) { - wattroff(_cons_win, COLOUR_AWAY); - } else if (strcmp(show, "chat") == 0) { - wattroff(_cons_win, COLOUR_CHAT); - } else if (strcmp(show, "dnd") == 0) { - wattroff(_cons_win, COLOUR_DND); - } else if (strcmp(show, "xa") == 0) { - wattroff(_cons_win, COLOUR_XA); - } else { - wattroff(_cons_win, COLOUR_OFFLINE); + if (strcmp(show, "online") == 0) { + wattroff(_cons_win, COLOUR_ONLINE); + } else if (strcmp(show, "away") == 0) { + wattroff(_cons_win, COLOUR_AWAY); + } else if (strcmp(show, "chat") == 0) { + wattroff(_cons_win, COLOUR_CHAT); + } else if (strcmp(show, "dnd") == 0) { + wattroff(_cons_win, COLOUR_DND); + } else if (strcmp(show, "xa") == 0) { + wattroff(_cons_win, COLOUR_XA); + } else { + wattroff(_cons_win, COLOUR_OFFLINE); + } } curr = g_slist_next(curr);