about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--src/command/command.c9
-rw-r--r--src/command/commands.c10
2 files changed, 16 insertions, 3 deletions
diff --git a/src/command/command.c b/src/command/command.c
index ccf06740..31af72c4 100644
--- a/src/command/command.c
+++ b/src/command/command.c
@@ -106,7 +106,7 @@ static struct cmd_t command_defs[] =
           "--------------------------------------------",
           "Connect to an XMPP service using the specified account.",
           "Use the server property to specify a server if required.",
-          "Change the default port with the port property.",
+          "Change the default port (5222, or 5223 for SSL) with the port property.",
           "An account is automatically created if one does not exist.",
           "See the /account command for more details.",
           "",
@@ -697,6 +697,7 @@ static struct cmd_t command_defs[] =
           "The set command may use one of the following for 'property'.",
           "jid              : The Jabber ID of the account, the account name will be used if this property is not set.",
           "server           : The chat server, if different to the domainpart of the JID.",
+          "port             : The port used for connecting if not the default (5222, or 5223 for SSL).",
           "status           : The presence status to use on login, use 'last' to use whatever your last status was.",
           "online|chat|away",
           "|xa|dnd          : Priority for the specified presence.",
@@ -709,8 +710,9 @@ static struct cmd_t command_defs[] =
           "password         : Clears the password for the account.",
           "",
           "Example : /account add work",
-          "        : /account set work jid myuser@mycompany.com",
-          "        : /account set work server talk.google.com",
+          "        : /account set work jid me@chatty",
+          "        : /account set work server talk.chat.com",
+          "        : /account set work port 5111",
           "        : /account set work resource desktop",
           "        : /account set work muc chatservice.mycompany.com",
           "        : /account set work nick dennis",
@@ -945,6 +947,7 @@ cmd_init(void)
     account_set_ac = autocomplete_new();
     autocomplete_add(account_set_ac, "jid");
     autocomplete_add(account_set_ac, "server");
+    autocomplete_add(account_set_ac, "port");
     autocomplete_add(account_set_ac, "status");
     autocomplete_add(account_set_ac, "online");
     autocomplete_add(account_set_ac, "chat");
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);