Handling commands after /disconnect

This commit is contained in:
James Booth
2012-11-19 23:15:42 +00:00
parent 346ed2a8e8
commit 118d97cd90
7 changed files with 97 additions and 18 deletions

View File

@@ -243,26 +243,38 @@ win_show_wins(void)
case WIN_CHAT:
wprintw(_cons_win, "%d: chat %s", i + 1, _wins[i].from);
PContact contact = contact_list_get_contact(_wins[i].from);
if (p_contact_name(contact) != NULL) {
wprintw(_cons_win, " (%s)", p_contact_name(contact));
if (contact != NULL) {
if (p_contact_name(contact) != NULL) {
wprintw(_cons_win, " (%s)", p_contact_name(contact));
}
wprintw(_cons_win, " - %s", p_contact_presence(contact));
}
wprintw(_cons_win, " - %s", p_contact_presence(contact));
if (_wins[i].unread > 0) {
wprintw(_cons_win, ", %d unread", _wins[i].unread);
}
break;
case WIN_PRIVATE:
wprintw(_cons_win, "%d: private %s", i + 1, _wins[i].from);
if (_wins[i].unread > 0) {
wprintw(_cons_win, ", %d unread", _wins[i].unread);
}
break;
case WIN_MUC:
wprintw(_cons_win, "%d: room %s", i + 1, _wins[i].from);
if (_wins[i].unread > 0) {
wprintw(_cons_win, ", %d unread", _wins[i].unread);
}
break;
default:
break;
}
@@ -976,7 +988,7 @@ win_disconnected(void)
// show message in all active chats
for (i = 1; i < NUM_WINS; i++) {
if (strcmp(_wins[i].from, "") != 0) {
WINDOW *win = _wins[_curr_prof_win].win;
WINDOW *win = _wins[i].win;
_win_show_time(win);
wattron(win, COLOUR_ERR);
wprintw(win, "%s\n", "Lost connection.");