Handle /who command in chat rooms

This commit is contained in:
James Booth
2013-01-15 23:17:07 +00:00
parent efdd3e55db
commit 02a71e2510
4 changed files with 90 additions and 10 deletions

View File

@@ -810,21 +810,27 @@ win_join_chat(Jid *jid)
}
void
win_show_room_roster(const char * const room)
win_show_room_roster(const char * const room, GList *roster, const char * const presence)
{
int win_index = _find_prof_win_index(room);
WINDOW *win = windows[win_index]->win;
GList *roster = muc_get_roster(room);
_win_show_time(win, '!');
if ((roster == NULL) || (g_list_length(roster) == 0)) {
wattron(win, COLOUR_ROOMINFO);
wprintw(win, "Room is empty.\n");
if (presence == NULL) {
wprintw(win, "Room is empty.\n");
} else {
wprintw(win, "No participants are %s.\n", presence);
}
wattroff(win, COLOUR_ROOMINFO);
} else {
wattron(win, COLOUR_ROOMINFO);
wprintw(win, "Participants: ");
if (presence == NULL) {
wprintw(win, "Participants: ");
} else {
wprintw(win, "Participants (%s): ", presence);
}
wattroff(win, COLOUR_ROOMINFO);
wattron(win, COLOUR_ONLINE);