Using /who in chat room shows room occupants

This commit is contained in:
James Booth
2012-11-08 00:22:15 +00:00
parent 181669a8cb
commit c967cd9dc9
2 changed files with 55 additions and 49 deletions

View File

@@ -502,22 +502,23 @@ win_show_room_roster(const char * const room)
GList *roster = room_get_roster(room);
if (roster != NULL) {
if ((roster == NULL) || (g_list_length(roster) == 0)) {
wprintw(win, "You are alone!\n");
} else {
wprintw(win, "Room occupants:\n");
}
wattron(win, COLOUR_ONLINE);
wattron(win, COLOUR_ONLINE);
while (roster != NULL) {
wprintw(win, "%s", roster->data);
if (roster->next != NULL) {
wprintw(win, ", ");
while (roster != NULL) {
wprintw(win, "%s", roster->data);
if (roster->next != NULL) {
wprintw(win, ", ");
}
roster = g_list_next(roster);
}
roster = g_list_next(roster);
}
wprintw(win, "\n");
wattroff(win, COLOUR_ONLINE);
wprintw(win, "\n");
wattroff(win, COLOUR_ONLINE);
}
if (win_index == _curr_prof_win)
dirty = TRUE;