about summary refs log tree commit diff stats
path: root/src/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/console.c4
-rw-r--r--src/ui/rosterwin.c30
2 files changed, 31 insertions, 3 deletions
diff --git a/src/ui/console.c b/src/ui/console.c
index 8825cf69..882a9b54 100644
--- a/src/ui/console.c
+++ b/src/ui/console.c
@@ -1226,6 +1226,10 @@ cons_roster_setting(void)
     cons_show("Roster by (/roster)           : %s", by);
     prefs_free_string(by);
 
+    char *order = prefs_get_string(PREF_ROSTER_ORDER);
+    cons_show("Roster order (/roster)        : %s", order);
+    prefs_free_string(order);
+
     int size = prefs_get_roster_size();
     cons_show("Roster size (/roster)         : %d", size);
 }
diff --git a/src/ui/rosterwin.c b/src/ui/rosterwin.c
index b721dbfe..95d374bd 100644
--- a/src/ui/rosterwin.c
+++ b/src/ui/rosterwin.c
@@ -167,7 +167,15 @@ _rosterwin_contacts_by_group(ProfLayoutSplit *layout, char *group)
     g_string_free(title, TRUE);
     wattroff(layout->subwin, theme_attrs(THEME_ROSTER_HEADER));
 
-    GSList *contacts = roster_get_group(group);
+    GSList *contacts = NULL;
+
+    char *order = prefs_get_string(PREF_ROSTER_ORDER);
+    if (g_strcmp0(order, "presence") == 0) {
+        contacts = roster_get_group_ord_presence(group);
+    } else {
+        contacts = roster_get_group(group);
+    }
+
     if (contacts) {
         GSList *curr_contact = contacts;
         while (curr_contact) {
@@ -182,7 +190,15 @@ _rosterwin_contacts_by_group(ProfLayoutSplit *layout, char *group)
 static void
 _rosterwin_contacts_by_no_group(ProfLayoutSplit *layout)
 {
-    GSList *contacts = roster_get_nogroup();
+    GSList *contacts = NULL;
+
+    char *order = prefs_get_string(PREF_ROSTER_ORDER);
+    if (g_strcmp0(order, "presence") == 0) {
+        contacts = roster_get_nogroup_ord_presence();
+    } else {
+        contacts = roster_get_nogroup();
+    }
+
     if (contacts) {
         wattron(layout->subwin, theme_attrs(THEME_ROSTER_HEADER));
         win_printline_nowrap(layout->subwin, " -no group");
@@ -228,7 +244,15 @@ rosterwin_roster(void)
             g_slist_free_full(groups, free);
             _rosterwin_contacts_by_no_group(layout);
         } else {
-            GSList *contacts = roster_get_contacts();
+            GSList *contacts = NULL;
+
+            char *order = prefs_get_string(PREF_ROSTER_ORDER);
+            if (g_strcmp0(order, "presence") == 0) {
+                contacts = roster_get_contacts_ord_presence();
+            } else {
+                contacts = roster_get_contacts();
+            }
+
             if (contacts) {
                 werase(layout->subwin);