about summary refs log tree commit diff stats
path: root/src/command/cmd_defs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/command/cmd_defs.c')
-rw-r--r--src/command/cmd_defs.c79
1 files changed, 55 insertions, 24 deletions
diff --git a/src/command/cmd_defs.c b/src/command/cmd_defs.c
index ae77bf53..418155c4 100644
--- a/src/command/cmd_defs.c
+++ b/src/command/cmd_defs.c
@@ -1,7 +1,7 @@
 /*
  * cmd_defs.c
  *
- * Copyright (C) 2012 - 2017 James Booth <boothj5@gmail.com>
+ * Copyright (C) 2012 - 2018 James Booth <boothj5@gmail.com>
  *
  * This file is part of Profanity.
  *
@@ -158,7 +158,7 @@ static struct cmd_t command_defs[] =
             CMD_TAG_CONNECTION)
         CMD_SYN(
             "/connect [<account>]",
-            "/connect <account> [server <server>] [port <port>] [tls force|allow|disable]")
+            "/connect <account> [server <server>] [port <port>] [tls force|allow|legacy|disable]")
         CMD_DESC(
             "Login to a chat service. "
             "If no account is specified, the default is used if one is configured. "
@@ -169,6 +169,7 @@ static struct cmd_t command_defs[] =
             { "port <port>",       "The port to use if different to the default (5222, or 5223 for SSL)." },
             { "tls force",         "Force TLS connection, and fail if one cannot be established, this is default behaviour." },
             { "tls allow",         "Use TLS for the connection if it is available." },
+            { "tls legacy",        "Use legacy TLS for the connection. It means server doesn't support STARTTLS and TLS is forced just after TCP connection is established." },
             { "tls disable",       "Disable TLS for the connection." })
         CMD_EXAMPLES(
             "/connect",
@@ -286,6 +287,8 @@ static struct cmd_t command_defs[] =
             "/roster room by service|none",
             "/roster room order name|unread",
             "/roster room unread before|after|off",
+            "/roster room show server",
+            "/roster room hide server",
             "/roster private room|group|off",
             "/roster private char <char>|none",
             "/roster header char <char>|none",
@@ -351,6 +354,8 @@ static struct cmd_t command_defs[] =
             { "room unread before",         "Show unread message count before room." },
             { "room unread after",          "Show unread message count after room." },
             { "room unread off",            "Do not show unread message count for rooms." },
+            { "room show server",           "Show the conference server with room JIDs." },
+            { "room hide server",           "Do not show the conference server with room JIDs." },
             { "private room",               "Show room private chats with the room." },
             { "private group",              "Show room private chats as a separate roster group." },
             { "private off",                "Do not show room private chats." },
@@ -783,20 +788,31 @@ static struct cmd_t command_defs[] =
     },
 
     { "/rooms",
-        parse_args, 0, 1, NULL,
+        parse_args, 0, 4, NULL,
         CMD_NOSUBFUNCS
         CMD_MAINFUNC(cmd_rooms)
         CMD_TAGS(
             CMD_TAG_GROUPCHAT)
         CMD_SYN(
-            "/rooms [<service>]")
+            "/rooms",
+            "/rooms filter <text>",
+            "/rooms service <service>",
+            "/rooms service <service> filter <text>",
+            "/rooms cache on|off|clear")
         CMD_DESC(
             "List the chat rooms available at the specified conference service. "
-            "If no argument is supplied, the account preference 'muc.service' is used, 'conference.<domain-part>' by default.")
+            "If no argument is supplied, the account preference 'muc.service' is used, 'conference.<domain-part>' by default. "
+            "The filter argument only shows rooms that contain the provided text, case insensitive.")
         CMD_ARGS(
-            { "<service>", "The conference service to query." })
+            { "service <service>",  "The conference service to query." },
+            { "filter <text>",      "The text to filter results by."},
+            { "cache on|off",       "Enable or disable caching of rooms list response, enabled by default."},
+            { "cache clear",        "Clear the rooms response cache if enabled."})
         CMD_EXAMPLES(
-            "/rooms conference.jabber.org")
+            "/rooms",
+            "/rooms filter development",
+            "/rooms service conference.jabber.org",
+            "/rooms service conference.jabber.org filter \"News Room\"")
     },
 
     { "/bookmark",
@@ -946,18 +962,14 @@ static struct cmd_t command_defs[] =
         parse_args, 0, 3, NULL,
         CMD_SUBFUNCS(
             { "unread",     cmd_wins_unread },
-            { "tidy",       cmd_wins_tidy },
             { "prune",      cmd_wins_prune },
-            { "swap",       cmd_wins_swap },
-            { "autotidy",   cmd_wins_autotidy })
+            { "swap",       cmd_wins_swap })
         CMD_MAINFUNC(cmd_wins)
         CMD_TAGS(
             CMD_TAG_UI)
         CMD_SYN(
             "/wins",
             "/wins unread",
-            "/wins tidy",
-            "/wins autotidy on|off",
             "/wins prune",
             "/wins swap <source> <target>")
         CMD_DESC(
@@ -965,9 +977,7 @@ static struct cmd_t command_defs[] =
             "Passing no argument will list all currently active windows and information about their usage.")
         CMD_ARGS(
             { "unread",                 "List windows with unread messages." },
-            { "tidy",                   "Move windows so there are no gaps." },
-            { "autotidy on|off",        "Automatically remove gaps when closing windows." },
-            { "prune",                  "Close all windows with no unread messages, and then tidy so there are no gaps." },
+            { "prune",                  "Close all windows with no unread messages." },
             { "swap <source> <target>", "Swap windows, target may be an empty position." })
         CMD_NOEXAMPLES
     },
@@ -1342,20 +1352,40 @@ static struct cmd_t command_defs[] =
     },
 
     { "/statusbar",
-        parse_args, 1, 1, &cons_winpos_setting,
+        parse_args, 1, 2, &cons_statusbar_setting,
         CMD_NOSUBFUNCS
         CMD_MAINFUNC(cmd_statusbar)
         CMD_TAGS(
             CMD_TAG_UI)
         CMD_SYN(
+            "/statusbar show name|number",
+            "/statusbar hide name|number",
+            "/statusbar maxtabs <value>",
+            "/statusbar tablen <value>",
+            "/statusbar self user|barejid|fulljid|off",
+            "/statusbar chat user|jid",
+            "/statusbar room room|jid",
             "/statusbar up",
             "/statusbar down")
         CMD_DESC(
-            "Move the status bar.")
-        CMD_ARGS(
-            { "up", "Move the status bar up the screen." },
-            { "down", "Move the status bar down the screen." })
-        CMD_NOEXAMPLES
+            "Manage statusbar display preferences.")
+        CMD_ARGS(
+            { "maxtabs <value>",            "Set the maximum number of tabs to display, <value> must be between 0 and 10" },
+            { "tablen <value>",             "Set the maximum number of characters to show as the tab name, 0 sets to unlimited." },
+            { "show|hide name",             "Show or hide names in tabs." },
+            { "show|hide number",           "Show or hide numbers in tabs." },
+            { "self user|barejid|fulljid",  "Show account user name, barejid, fulljid as status bar title." },
+            { "self off",                   "Disable showing self as status bar title." },
+            { "chat user|jid",              "Show users name, or the fulljid if no nick is present for chat tabs." },
+            { "room room|jid",              "Show room name, or the fulljid for room tabs." },
+            { "up",                         "Move the status bar up the screen." },
+            { "down",                       "Move the status bar down the screen." })
+        CMD_EXAMPLES(
+            "/statusbar maxtabs 8",
+            "/statusbar tablen 5",
+            "/statusbar self user",
+            "/statusbar chat jid",
+            "/statusbar hide name")
     },
 
     { "/inputwin",
@@ -1984,7 +2014,7 @@ static struct cmd_t command_defs[] =
             "/account set <account> otr <policy>",
             "/account set <account> pgpkeyid <pgpkeyid>",
             "/account set <account> startscript <script>",
-            "/account set <account> tls force|allow|disable",
+            "/account set <account> tls force|allow|legacy|disable",
             "/account set <account> theme <theme>",
             "/account clear <account> password",
             "/account clear <account> eval_password",
@@ -2024,6 +2054,7 @@ static struct cmd_t command_defs[] =
             { "set <account> startscript <script>",     "Set the script to execute after connecting." },
             { "set <account> tls force",                "Force TLS connection, and fail if one cannot be established, this is default behaviour." },
             { "set <account> tls allow",                "Use TLS for the connection if it is available." },
+            { "set <account> tls legacy",               "Use legacy TLS for the connection. It means server doesn't support STARTTLS and TLS is forced just after TCP connection is established." },
             { "set <account> tls disable",              "Disable TLS for the connection." },
             { "set <account> <theme>",                  "Set the UI theme for the account." },
             { "clear <account> server",                 "Remove the server setting for this account." },
@@ -2384,7 +2415,7 @@ cmd_init(void)
 
     cmd_ac_init();
 
-    search_index = g_hash_table_new_full(g_str_hash, g_str_equal, free, free);
+    search_index = g_hash_table_new_full(g_str_hash, g_str_equal, free, g_free);
 
     // load command defs into hash table
     commands = g_hash_table_new(g_str_hash, g_str_equal);
@@ -2396,7 +2427,7 @@ cmd_init(void)
         g_hash_table_insert(commands, pcmd->cmd, pcmd);
 
         // add to search index
-        g_hash_table_insert(search_index, strdup(pcmd->cmd), strdup(_cmd_index(pcmd)));
+        g_hash_table_insert(search_index, strdup(pcmd->cmd), _cmd_index(pcmd));
 
         // add to commands and help autocompleters
         cmd_ac_add_cmd(pcmd);