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.c86
1 files changed, 48 insertions, 38 deletions
diff --git a/src/command/commands.c b/src/command/commands.c
index d352fd5a..8d2306e8 100644
--- a/src/command/commands.c
+++ b/src/command/commands.c
@@ -1756,25 +1756,14 @@ cmd_roster(ProfWin *window, const char *const command, gchar **args)
             cons_bad_cmd_usage(command);
             return TRUE;
         } else {
-            int res =  _cmd_set_boolean_preference(args[1], command, "Roster panel line wrap", PREF_ROSTER_WRAP);
+            int res = _cmd_set_boolean_preference(args[1], command, "Roster panel line wrap", PREF_ROSTER_WRAP);
             rosterwin_roster();
             return res;
         }
 
-    // roster join with previous line
-    } else if (g_strcmp0(args[0], "resource") == 0) {
-        if (g_strcmp0(args[1], "join") == 0) {
-            int res =  _cmd_set_boolean_preference(args[2], command, "Roster join", PREF_ROSTER_RESOURCE_JOIN);
-            rosterwin_roster();
-            return res;
-        } else {
-            cons_bad_cmd_usage(command);
-            return TRUE;
-        }
-
-    // set header character
-    } else if (g_strcmp0(args[0], "char") == 0) {
-        if (g_strcmp0(args[1], "header") == 0) {
+    // header settings
+    } else if (g_strcmp0(args[0], "header") == 0) {
+        if (g_strcmp0(args[1], "char") == 0) {
             if (!args[2]) {
                 cons_bad_cmd_usage(command);
             } else if (g_strcmp0(args[2], "none") == 0) {
@@ -1786,7 +1775,14 @@ cmd_roster(ProfWin *window, const char *const command, gchar **args)
                 cons_show("Roster header char set to %c.", args[2][0]);
                 rosterwin_roster();
             }
-        } else if (g_strcmp0(args[1], "contact") == 0) {
+        } else {
+            cons_bad_cmd_usage(command);
+        }
+        return TRUE;
+
+    // contact settings
+    } else if (g_strcmp0(args[0], "contact") == 0) {
+        if (g_strcmp0(args[1], "char") == 0) {
             if (!args[2]) {
                 cons_bad_cmd_usage(command);
             } else if (g_strcmp0(args[2], "none") == 0) {
@@ -1798,26 +1794,7 @@ cmd_roster(ProfWin *window, const char *const command, gchar **args)
                 cons_show("Roster contact char set to %c.", args[2][0]);
                 rosterwin_roster();
             }
-        } else if (g_strcmp0(args[1], "resource") == 0) {
-            if (!args[2]) {
-                cons_bad_cmd_usage(command);
-            } else if (g_strcmp0(args[2], "none") == 0) {
-                prefs_clear_roster_resource_char();
-                cons_show("Roster resource char removed.");
-                rosterwin_roster();
-            } else {
-                prefs_set_roster_resource_char(args[2][0]);
-                cons_show("Roster resource char set to %c.", args[2][0]);
-                rosterwin_roster();
-            }
-        } else {
-            cons_bad_cmd_usage(command);
-        }
-        return TRUE;
-
-    // set indentations
-    } else if (g_strcmp0(args[0], "indent") == 0) {
-        if (g_strcmp0(args[1], "contact") == 0) {
+        } else if (g_strcmp0(args[1], "indent") == 0) {
             if (!args[2]) {
                 cons_bad_cmd_usage(command);
             } else {
@@ -1833,7 +1810,26 @@ cmd_roster(ProfWin *window, const char *const command, gchar **args)
                     free(err_msg);
                 }
             }
-        } else if (g_strcmp0(args[1], "resource") == 0) {
+        } else {
+            cons_bad_cmd_usage(command);
+        }
+        return TRUE;
+
+    // resource settings
+    } else if (g_strcmp0(args[0], "resource") == 0) {
+        if (g_strcmp0(args[1], "char") == 0) {
+            if (!args[2]) {
+                cons_bad_cmd_usage(command);
+            } else if (g_strcmp0(args[2], "none") == 0) {
+                prefs_clear_roster_resource_char();
+                cons_show("Roster resource char removed.");
+                rosterwin_roster();
+            } else {
+                prefs_set_roster_resource_char(args[2][0]);
+                cons_show("Roster resource char set to %c.", args[2][0]);
+                rosterwin_roster();
+            }
+        } else if (g_strcmp0(args[1], "indent") == 0) {
             if (!args[2]) {
                 cons_bad_cmd_usage(command);
             } else {
@@ -1849,7 +1845,18 @@ cmd_roster(ProfWin *window, const char *const command, gchar **args)
                     free(err_msg);
                 }
             }
-        } else if (g_strcmp0(args[1], "presence") == 0) {
+        } else if (g_strcmp0(args[1], "join") == 0) {
+            int res = _cmd_set_boolean_preference(args[2], command, "Roster join", PREF_ROSTER_RESOURCE_JOIN);
+            rosterwin_roster();
+            return res;
+        } else {
+            cons_bad_cmd_usage(command);
+        }
+        return TRUE;
+
+    // presence settings
+    } else if (g_strcmp0(args[0], "presence") == 0) {
+        if (g_strcmp0(args[1], "indent") == 0) {
             if (!args[2]) {
                 cons_bad_cmd_usage(command);
             } else {
@@ -1993,6 +2000,7 @@ cmd_roster(ProfWin *window, const char *const command, gchar **args)
             cons_bad_cmd_usage(command);
             return TRUE;
         }
+
     // roster grouping
     } else if (g_strcmp0(args[0], "by") == 0) {
         if (g_strcmp0(args[1], "group") == 0) {
@@ -2020,6 +2028,7 @@ cmd_roster(ProfWin *window, const char *const command, gchar **args)
             cons_bad_cmd_usage(command);
             return TRUE;
         }
+
     // roster item order
     } else if (g_strcmp0(args[0], "order") == 0) {
         if (g_strcmp0(args[1], "name") == 0) {
@@ -2040,6 +2049,7 @@ cmd_roster(ProfWin *window, const char *const command, gchar **args)
             cons_bad_cmd_usage(command);
             return TRUE;
         }
+
     // add contact
     } else if (strcmp(args[0], "add") == 0) {
         if (conn_status != JABBER_CONNECTED) {