diff options
author | James Booth <boothj5@gmail.com> | 2014-05-10 01:05:03 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2014-05-10 01:05:03 +0100 |
commit | c0fc4256dee9ac1a103ad39f2bc3560fda5d994a (patch) | |
tree | cce0f10b77f2f29f2478a2270e458eb7b29d1990 /src/ui | |
parent | d2662a6f174402a045bf400a4659e7fc9155cc34 (diff) | |
download | profani-tty-c0fc4256dee9ac1a103ad39f2bc3560fda5d994a.tar.gz |
Highlight active rooms in bookmark list
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/console.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/ui/console.c b/src/ui/console.c index 588f6001..7aac2e21 100644 --- a/src/ui/console.c +++ b/src/ui/console.c @@ -32,6 +32,7 @@ #include "command/command.h" #include "common.h" #include "log.h" +#include "muc.h" #include "roster_list.h" #include "config/preferences.h" #include "config/theme.h" @@ -651,11 +652,14 @@ _cons_show_bookmarks(const GList *list) cons_show(""); cons_show("Bookmarks:"); - /* TODO: show status (connected or not) and window number */ while (list != NULL) { Bookmark *item = list->data; win_print_time(console, '-'); + + if (muc_room_is_active(item->jid)) { + wattron(console->win, COLOUR_ONLINE); + } wprintw(console->win, " %s", item->jid); if (item->nick != NULL) { wprintw(console->win, "/%s", item->nick); @@ -666,6 +670,16 @@ _cons_show_bookmarks(const GList *list) if (item->password != NULL) { wprintw(console->win, " (private)"); } + if (muc_room_is_active(item->jid)) { + ProfWin *roomwin = wins_get_by_recipient(item->jid); + if (roomwin != NULL) { + int num = wins_get_num(roomwin); + wprintw(console->win, " ("); + wprintw(console->win, "%d", num); + wprintw(console->win, ")"); + } + wattroff(console->win, COLOUR_ONLINE); + } wprintw(console->win, "\n"); list = g_list_next(list); } |