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

Removed subscribed check when displaying roster panel

This commit is contained in:
James Booth 2015-07-02 00:01:37 +01:00
parent 10eb0bbbf8
commit fb8b223876

View File

@ -45,40 +45,38 @@
static void static void
_rosterwin_contact(ProfLayoutSplit *layout, PContact contact) _rosterwin_contact(ProfLayoutSplit *layout, PContact contact)
{ {
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);
if ((g_strcmp0(presence, "offline") != 0) || ((g_strcmp0(presence, "offline") == 0) && if ((g_strcmp0(presence, "offline") != 0) || ((g_strcmp0(presence, "offline") == 0) &&
(prefs_get_boolean(PREF_ROSTER_OFFLINE)))) { (prefs_get_boolean(PREF_ROSTER_OFFLINE)))) {
theme_item_t presence_colour = theme_main_presence_attrs(presence); theme_item_t presence_colour = theme_main_presence_attrs(presence);
wattron(layout->subwin, theme_attrs(presence_colour)); wattron(layout->subwin, theme_attrs(presence_colour));
GString *msg = g_string_new(" "); GString *msg = g_string_new(" ");
g_string_append(msg, name); g_string_append(msg, name);
win_printline_nowrap(layout->subwin, msg->str); win_printline_nowrap(layout->subwin, msg->str);
g_string_free(msg, TRUE); g_string_free(msg, TRUE);
wattroff(layout->subwin, theme_attrs(presence_colour)); wattroff(layout->subwin, theme_attrs(presence_colour));
if (prefs_get_boolean(PREF_ROSTER_RESOURCE)) { if (prefs_get_boolean(PREF_ROSTER_RESOURCE)) {
GList *resources = p_contact_get_available_resources(contact); GList *resources = p_contact_get_available_resources(contact);
GList *curr_resource = resources; GList *curr_resource = resources;
while (curr_resource) { while (curr_resource) {
Resource *resource = curr_resource->data; Resource *resource = curr_resource->data;
const char *resource_presence = string_from_resource_presence(resource->presence); const char *resource_presence = string_from_resource_presence(resource->presence);
theme_item_t resource_presence_colour = theme_main_presence_attrs(resource_presence); theme_item_t resource_presence_colour = theme_main_presence_attrs(resource_presence);
wattron(layout->subwin, theme_attrs(resource_presence_colour)); wattron(layout->subwin, theme_attrs(resource_presence_colour));
GString *msg = g_string_new(" "); GString *msg = g_string_new(" ");
g_string_append(msg, resource->name); g_string_append(msg, resource->name);
win_printline_nowrap(layout->subwin, msg->str); win_printline_nowrap(layout->subwin, msg->str);
g_string_free(msg, TRUE); g_string_free(msg, TRUE);
wattroff(layout->subwin, theme_attrs(resource_presence_colour)); wattroff(layout->subwin, theme_attrs(resource_presence_colour));
curr_resource = g_list_next(curr_resource); curr_resource = g_list_next(curr_resource);
}
g_list_free(resources);
} }
g_list_free(resources);
} }
} }
} }