about summary refs log tree commit diff stats
path: root/src/command
diff options
context:
space:
mode:
Diffstat (limited to 'src/command')
-rw-r--r--src/command/cmd_ac.c12
-rw-r--r--src/command/cmd_defs.c9
-rw-r--r--src/command/cmd_funcs.c20
3 files changed, 31 insertions, 10 deletions
diff --git a/src/command/cmd_ac.c b/src/command/cmd_ac.c
index 6b46d079..80daf3db 100644
--- a/src/command/cmd_ac.c
+++ b/src/command/cmd_ac.c
@@ -2484,6 +2484,13 @@ _ox_autocomplete(ProfWin* window, const char* const input, gboolean previous)
         }
     }
 
+    if (conn_status == JABBER_CONNECTED) {
+        found = autocomplete_param_with_func(input, "/ox discover", roster_contact_autocomplete, previous, NULL);
+         if (found) {
+             return found;
+        }
+    }
+
     found = autocomplete_param_with_ac(input, "/ox log", ox_log_ac, TRUE, previous);
     if (found) {
         return found;
@@ -2520,11 +2527,8 @@ _ox_autocomplete(ProfWin* window, const char* const input, gboolean previous)
     }
 
     found = autocomplete_param_with_ac(input, "/ox", ox_ac, TRUE, previous);
-    if (found) {
-        return found;
-    }
 
-    return NULL;
+    return found;
 }
 #endif
 
diff --git a/src/command/cmd_defs.c b/src/command/cmd_defs.c
index f5b111ac..b0076237 100644
--- a/src/command/cmd_defs.c
+++ b/src/command/cmd_defs.c
@@ -1717,10 +1717,11 @@ static struct cmd_t command_defs[] = {
               "/ox char <char>",
               "/ox sendfile on|off",
               "/ox announce <file>",
-              "/ox discover",
-              "/ox request <jid>")
+              "/ox discover <jid>",
+              "/ox request <jid> <keyid>")
       CMD_DESC(
-              "OpenPGP (OX) commands to manage keys, and perform PGP encryption during chat sessions. ")
+             "OpenPGP (OX) commands to manage keys, and perform OpenPGP encryption during chat sessions."
+              "Your key need a OpenPGP UI with xmpp:local@domain.tld as name.")
       CMD_ARGS(
               { "keys", "List all keys known to the system." },
               { "contacts", "Show contacts with assigned public keys." },
@@ -1730,7 +1731,7 @@ static struct cmd_t command_defs[] = {
               { "log redact", "Log PGP encrypted messages, but replace the contents with [redacted]. This is the default." },
               { "char <char>", "Set the character to be displayed next to PGP encrypted messages." },
               { "announce <file>", "Announce a public key by pushing it on the XMPP Server" },
-              { "discover <jid>", "Discover public keys of a jid " },
+              { "discover <jid>", "Discover public keys of a jid. The keyids will be displayed" },
               { "request <jid>", "Request public keys" },
               { "sendfile on|off", "Allow /sendfile to send unencrypted files while otherwise using PGP." })
       CMD_EXAMPLES(
diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c
index e1108982..185c55a0 100644
--- a/src/command/cmd_funcs.c
+++ b/src/command/cmd_funcs.c
@@ -7453,6 +7453,22 @@ cmd_ox(ProfWin* window, const char* const command, gchar** args)
         return TRUE;
     }
 
+    if (strcmp(args[0], "char") == 0) {
+        if (args[1] == NULL) {
+            cons_bad_cmd_usage(command);
+            return TRUE;
+        } else if (g_utf8_strlen(args[1], 4) == 1) {
+            if (prefs_set_ox_char(args[1])) {
+                cons_show("OX char set to %s.", args[1]);
+            } else {
+                cons_show_error("Could not set OX char: %s.", args[1]);
+            }
+            return TRUE;
+        }
+        cons_bad_cmd_usage(command);
+        return TRUE;
+    }
+
     // The '/ox keys' command - same like in pgp
     // Should we move this to a common command
     // e.g. '/openpgp keys'?.
@@ -7597,13 +7613,13 @@ cmd_ox(ProfWin* window, const char* const command, gchar** args)
         if (args[1]) {
             ox_discover_public_key(args[1]);
         } else {
-            cons_show("JID is required");
+            cons_show("To discover the OpenPGP keys of an user, the JID is required");
         }
     } else if (g_strcmp0(args[0], "request") == 0) {
         if (args[1] && args[2]) {
             ox_request_public_key(args[1], args[2]);
         } else {
-            cons_show("JID and Fingerprint is required");
+            cons_show("JID and KeyID is required");
         }
     } else {
         cons_show("OX not implemented");