about summary refs log tree commit diff stats
path: root/src/command/commands.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/command/commands.c')
-rw-r--r--src/command/commands.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/command/commands.c b/src/command/commands.c
index e94c9e3c..5075d0b3 100644
--- a/src/command/commands.c
+++ b/src/command/commands.c
@@ -2184,6 +2184,31 @@ cmd_roster(ProfWin *window, const char *const command, gchar **args)
             return TRUE;
         }
 
+    } else if (g_strcmp0(args[0], "room") == 0) {
+        if (g_strcmp0(args[1], "order") == 0) {
+            if (g_strcmp0(args[2], "name") == 0) {
+                cons_show("Ordering roster rooms by name");
+                prefs_set_string(PREF_ROSTER_ROOMS_ORDER, "name");
+                if (conn_status == JABBER_CONNECTED) {
+                    rosterwin_roster();
+                }
+                return TRUE;
+            } else if (g_strcmp0(args[2], "unread") == 0) {
+                cons_show("Ordering roster rooms by unread messages");
+                prefs_set_string(PREF_ROSTER_ROOMS_ORDER, "unread");
+                if (conn_status == JABBER_CONNECTED) {
+                    rosterwin_roster();
+                }
+                return TRUE;
+            } else {
+                cons_bad_cmd_usage(command);
+                return TRUE;
+            }
+        } else {
+            cons_bad_cmd_usage(command);
+            return TRUE;
+        }
+
     // add contact
     } else if (strcmp(args[0], "add") == 0) {
         if (conn_status != JABBER_CONNECTED) {