about summary refs log tree commit diff stats
path: root/src/command/commands.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2015-11-21 21:49:12 +0000
committerJames Booth <boothj5@gmail.com>2015-11-21 21:49:12 +0000
commitef0f093efde451ff9c73e304bf50020385942d55 (patch)
tree52917b2ec14dbcd82eb2929e97b0e22c5c6b4765 /src/command/commands.c
parentf54c2e8ecab9134eca315313bfd269a0261e4763 (diff)
downloadprofani-tty-ef0f093efde451ff9c73e304bf50020385942d55.tar.gz
Added /roster indent resource
Diffstat (limited to 'src/command/commands.c')
-rw-r--r--src/command/commands.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/command/commands.c b/src/command/commands.c
index 7a97625a..8de6a6df 100644
--- a/src/command/commands.c
+++ b/src/command/commands.c
@@ -1799,6 +1799,22 @@ cmd_roster(ProfWin *window, const char *const command, gchar **args)
                     free(err_msg);
                 }
             }
+        } else if (g_strcmp0(args[1], "resource") == 0) {
+            if (!args[2]) {
+                cons_bad_cmd_usage(command);
+            } else {
+                int intval = 0;
+                char *err_msg = NULL;
+                gboolean res = strtoi_range(args[2], &intval, 0, 10, &err_msg);
+                if (res) {
+                    prefs_set_roster_resource_indent(intval);
+                    cons_show("Roster resource indent set to: %d", intval);
+                    rosterwin_roster();
+                } else {
+                    cons_show(err_msg);
+                    free(err_msg);
+                }
+            }
         } else {
             cons_bad_cmd_usage(command);
         }