diff options
author | James Booth <boothj5@gmail.com> | 2016-01-30 22:23:59 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2016-01-30 22:23:59 +0000 |
commit | 7c4a63f3c2dd4ada51dedae8ec143ef48338d8de (patch) | |
tree | b4699c9fcc13b8d884de7a4aebd593ca9f721991 /src/ui | |
parent | b801a605a79a075dc4254055503dc30caead140e (diff) | |
download | profani-tty-7c4a63f3c2dd4ada51dedae8ec143ef48338d8de.tar.gz |
Moved offline check logic in roster panel
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/rosterwin.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/ui/rosterwin.c b/src/ui/rosterwin.c index ee57e145..ee92f322 100644 --- a/src/ui/rosterwin.c +++ b/src/ui/rosterwin.c @@ -354,6 +354,10 @@ _rosterwin_contact(ProfLayoutSplit *layout, PContact contact) static void _rosterwin_contacts_by_presence(ProfLayoutSplit *layout, const char *const presence, char *title, gboolean newline) { + if ((g_strcmp0(presence, "offline") == 0) && !prefs_get_boolean(PREF_ROSTER_OFFLINE)) { + return; + } + GSList *contacts = roster_get_contacts_by_presence(presence); // if this group has contacts, or if we want to show empty groups @@ -910,9 +914,7 @@ rosterwin_roster(void) _rosterwin_contacts_by_presence(layout, "away", "Away", TRUE); _rosterwin_contacts_by_presence(layout, "xa", "Extended Away", TRUE); _rosterwin_contacts_by_presence(layout, "dnd", "Do not disturb", TRUE); - if (prefs_get_boolean(PREF_ROSTER_OFFLINE)) { - _rosterwin_contacts_by_presence(layout, "offline", "Offline", TRUE); - } + _rosterwin_contacts_by_presence(layout, "offline", "Offline", TRUE); } else if (g_strcmp0(by, "group") == 0) { GSList *groups = roster_get_groups(); GSList *curr_group = groups; |