1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

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

@ -895,6 +895,10 @@ _cmd_who(const char * const inp, struct cmd_help_t help)
cons_show("Usage: %s", help.usage); cons_show("Usage: %s", help.usage);
// valid arg // valid arg
} else {
if (win_in_groupchat()) {
char *room = win_get_recipient();
win_show_room_roster(room);
} else { } else {
GSList *list = get_contact_list(); GSList *list = get_contact_list();
@ -940,6 +944,7 @@ _cmd_who(const char * const inp, struct cmd_help_t help)
} }
} }
} }
}
return TRUE; return TRUE;
} }

View File

@ -502,10 +502,10 @@ win_show_room_roster(const char * const room)
GList *roster = room_get_roster(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"); wprintw(win, "Room occupants:\n");
}
wattron(win, COLOUR_ONLINE); wattron(win, COLOUR_ONLINE);
while (roster != NULL) { while (roster != NULL) {
@ -515,9 +515,10 @@ win_show_room_roster(const char * const room)
} }
roster = g_list_next(roster); roster = g_list_next(roster);
} }
wprintw(win, "\n");
wprintw(win, "\n");
wattroff(win, COLOUR_ONLINE); wattroff(win, COLOUR_ONLINE);
}
if (win_index == _curr_prof_win) if (win_index == _curr_prof_win)
dirty = TRUE; dirty = TRUE;