1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05:00

Highlight active rooms in bookmark list

This commit is contained in:
James Booth 2014-05-10 01:05:03 +01:00
parent d2662a6f17
commit c0fc4256de

View File

@ -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);
}