about summary refs log tree commit diff stats
path: root/src/ui/rosterwin.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/rosterwin.c')
-rw-r--r--src/ui/rosterwin.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/ui/rosterwin.c b/src/ui/rosterwin.c
index db9a4af6..e48be866 100644
--- a/src/ui/rosterwin.c
+++ b/src/ui/rosterwin.c
@@ -84,11 +84,15 @@ _rosterwin_contact(ProfLayoutSplit *layout, PContact contact)
 static void
 _rosterwin_contacts_by_presence(ProfLayoutSplit *layout, const char * const presence, char *title)
 {
-    wattron(layout->subwin, theme_attrs(THEME_ROSTER_HEADER));
-    win_printline_nowrap(layout->subwin, title);
-    wattroff(layout->subwin, theme_attrs(THEME_ROSTER_HEADER));
-
     GSList *contacts = roster_get_contacts_by_presence(presence);
+
+    // if this group has contacts, or if we want to show empty groups
+    if (contacts || prefs_get_boolean(PREF_ROSTER_EMPTY)) {
+        wattron(layout->subwin, theme_attrs(THEME_ROSTER_HEADER));
+        win_printline_nowrap(layout->subwin, title);
+        wattroff(layout->subwin, theme_attrs(THEME_ROSTER_HEADER));
+    }
+
     if (contacts) {
         GSList *curr_contact = contacts;
         while (curr_contact) {