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

Show resources and only subscribed contacts in roster panel

This commit is contained in:
James Booth 2014-11-10 00:46:20 +00:00
parent 36331e4908
commit 48afa52390

View File

@ -2818,6 +2818,7 @@ _ui_roster(void)
GSList *curr = contacts; GSList *curr = contacts;
while (curr) { while (curr) {
PContact contact = curr->data; PContact contact = curr->data;
if (p_contact_subscribed(contact)) {
const char *name = p_contact_name_or_jid(contact); const char *name = p_contact_name_or_jid(contact);
const char *presence = p_contact_presence(contact); const char *presence = p_contact_presence(contact);
int presence_colour = win_presence_colour(presence); int presence_colour = win_presence_colour(presence);
@ -2825,6 +2826,18 @@ _ui_roster(void)
wattron(window->subwin, presence_colour); wattron(window->subwin, presence_colour);
wprintw(window->subwin, " %s\n", name); wprintw(window->subwin, " %s\n", name);
wattroff(window->subwin, presence_colour); wattroff(window->subwin, presence_colour);
GList *resources = p_contact_get_available_resources(contact);
GList *curr_resource = resources;
while (curr_resource) {
Resource *resource = curr_resource->data;
const char *resource_presence = string_from_resource_presence(resource->presence);
int resource_presence_colour = win_presence_colour(resource_presence);
wattron(window->subwin, resource_presence_colour);
wprintw(window->subwin, " %s\n", resource->name);
wattroff(window->subwin, resource_presence_colour);
curr_resource = g_list_next(curr_resource);
}
}
curr = g_slist_next(curr); curr = g_slist_next(curr);
} }
} }