about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--src/command/cmd_funcs.c63
-rw-r--r--src/ui/occupantswin.c2
2 files changed, 31 insertions, 34 deletions
diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c
index 788c2f32..41b45bba 100644
--- a/src/command/cmd_funcs.c
+++ b/src/command/cmd_funcs.c
@@ -4370,6 +4370,37 @@ cmd_occupants(ProfWin *window, const char *const command, gchar **args)
         }
     }
 
+    if (g_strcmp0(args[0], "indent") == 0) {
+        if (!args[1]) {
+            cons_bad_cmd_usage(command);
+            return TRUE;
+        } else {
+            int intval = 0;
+            char *err_msg = NULL;
+            gboolean res = strtoi_range(args[1], &intval, 0, 10, &err_msg);
+            if (res) {
+                prefs_set_occupants_indent(intval);
+                cons_show("Occupants indent set to: %d", intval);
+
+                // get the list of joined rooms
+                GList *rooms = muc_rooms();
+                GList *curr = rooms;
+                while (curr) {
+                    char* roomjid = curr->data;
+                    ProfMucWin *mw = wins_get_muc(roomjid);
+                    if (mw != NULL)
+                       mucwin_update_occupants(mw);
+
+                    curr = g_list_next(curr);
+                }
+            } else {
+                cons_show(err_msg);
+                free(err_msg);
+            }
+            return TRUE;
+        }
+    }
+
     if (g_strcmp0(args[0], "default") == 0) {
         if (g_strcmp0(args[1], "show") == 0) {
             if (g_strcmp0(args[2], "jid") == 0) {
@@ -4409,38 +4440,6 @@ cmd_occupants(ProfWin *window, const char *const command, gchar **args)
     ProfMucWin *mucwin = (ProfMucWin*)window;
     assert(mucwin->memcheck == PROFMUCWIN_MEMCHECK);
 
-    if (g_strcmp0(args[0], "indent") == 0) {
-        if (!args[1]) {
-            cons_bad_cmd_usage(command);
-            return TRUE;
-        } else {
-            int intval = 0;
-            char *err_msg = NULL;
-            gboolean res = strtoi_range(args[1], &intval, 0, 10, &err_msg);
-            if (res) {
-                prefs_set_occupants_indent(intval);
-                cons_show("Occupants indent set to: %d", intval);
-
-                // get the list of joined rooms
-                GList *rooms = muc_rooms();
-                GList *curr = rooms;
-                while (curr) {
-                    char* roomjid = curr->data;
-                    ProfMucWin *mw = wins_get_muc(roomjid);
-                    if (mw != NULL)
-                       mucwin_update_occupants(mw);
-
-                    curr = g_list_next(curr);
-                }
-            } else {
-                cons_show(err_msg);
-                free(err_msg);
-            }
-            return TRUE;
-        }
-    }
-
-
     if (g_strcmp0(args[0], "show") == 0) {
         if (g_strcmp0(args[1], "jid") == 0) {
             mucwin->showjid = TRUE;
diff --git a/src/ui/occupantswin.c b/src/ui/occupantswin.c
index 3799046c..37dfb9e2 100644
--- a/src/ui/occupantswin.c
+++ b/src/ui/occupantswin.c
@@ -49,9 +49,7 @@ _occuptantswin_occupant(ProfLayoutSplit *layout, Occupant *occupant, gboolean sh
     GString *msg = g_string_new(" ");
 
     int indent = prefs_get_occupants_indent();
-    int current_indent = 0;
     if (indent > 0) {
-        current_indent += indent;
         while (indent > 0) {
             g_string_append(msg, " ");
             indent--;