about summary refs log tree commit diff stats
path: root/src/command/commands.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-01-19 00:05:04 +0000
committerJames Booth <boothj5@gmail.com>2014-01-19 00:05:04 +0000
commit0edfef5612d8be8e8e56fdf578265df62356d8bf (patch)
tree94bd5e3d3b26ec6b7993f83e8883680effa990ce /src/command/commands.c
parent47fe146a22dc2ab98b64dda3f1fb5bbcbb1d4277 (diff)
downloadprofani-tty-0edfef5612d8be8e8e56fdf578265df62356d8bf.tar.gz
Added /account set <account> port <port>
Diffstat (limited to 'src/command/commands.c')
-rw-r--r--src/command/commands.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/command/commands.c b/src/command/commands.c
index 27ecf9c5..90cf8134 100644
--- a/src/command/commands.c
+++ b/src/command/commands.c
@@ -289,6 +289,16 @@ cmd_account(gchar **args, struct cmd_help_t help)
                     accounts_set_server(account_name, value);
                     cons_show("Updated server for account %s: %s", account_name, value);
                     cons_show("");
+                } else if (strcmp(property, "port") == 0) {
+                    int port;
+                    if (_strtoi(value, &port, 1, 65535) != 0) {
+                        cons_show("");
+                        return TRUE;
+                    } else {
+                        accounts_set_port(account_name, port);
+                        cons_show("Updated port for account %s: %s", account_name, value);
+                        cons_show("");
+                    }
                 } else if (strcmp(property, "resource") == 0) {
                     accounts_set_resource(account_name, value);
                     cons_show("Updated resource for account %s: %s", account_name, value);