diff options
author | James Booth <boothj5@gmail.com> | 2013-05-30 22:31:43 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2013-05-30 22:31:43 +0100 |
commit | f164c12368594316bfce07c5c1876fa57ea3bcde (patch) | |
tree | 3857ab8d54c7e7fc2f4c79258b8789ab848d8cce /src | |
parent | 378ed3139a8c752292656b24fe8d0335356f03c6 (diff) | |
download | profani-tty-f164c12368594316bfce07c5c1876fa57ea3bcde.tar.gz |
Show participant count in chat rooms
Diffstat (limited to 'src')
-rw-r--r-- | src/ui/core.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/ui/core.c b/src/ui/core.c index 66aa7467..8624613b 100644 --- a/src/ui/core.c +++ b/src/ui/core.c @@ -1038,18 +1038,24 @@ ui_room_roster(const char * const room, GList *roster, const char * const presen if (presence == NULL) { wprintw(window->win, "Room is empty.\n"); } else { - wprintw(window->win, "No participants are %s.\n", presence); + wprintw(window->win, "No participants %s.\n", presence); } wattroff(window->win, COLOUR_ROOMINFO); } else { + int length = g_list_length(roster); wattron(window->win, COLOUR_ROOMINFO); if (presence == NULL) { - wprintw(window->win, "Participants: "); + length++; + wprintw(window->win, "%d participants: ", length); + wattroff(window->win, COLOUR_ROOMINFO); + wattron(window->win, COLOUR_ONLINE); + wprintw(window->win, "%s", muc_get_room_nick(room)); + wprintw(window->win, ", "); } else { - wprintw(window->win, "Participants (%s): ", presence); + wprintw(window->win, "%d %s: ", length, presence); + wattroff(window->win, COLOUR_ROOMINFO); + wattron(window->win, COLOUR_ONLINE); } - wattroff(window->win, COLOUR_ROOMINFO); - wattron(window->win, COLOUR_ONLINE); while (roster != NULL) { PContact member = roster->data; |