about summary refs log tree commit diff stats
path: root/src/command/cmd_defs.c
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2020-02-10 16:17:01 +0100
committerMichael Vetter <jubalh@iodoru.org>2020-02-10 16:17:01 +0100
commit11181100712fc2a1c2f310b4470d752488e8961e (patch)
treecd5b5341d86e48e7df09c6bfc9414dfc296144ca /src/command/cmd_defs.c
parent83b61e5160b6624eb0b2898c1321d33341e6510c (diff)
downloadprofani-tty-11181100712fc2a1c2f310b4470d752488e8961e.tar.gz
xep-0308: Implement `/correct` to correct the last send message
So far the correction is sent. But the UI in Profanity itself is not
updated.

Also autocompletion for `/correct` with the last sent message is
missing.
Diffstat (limited to 'src/command/cmd_defs.c')
-rw-r--r--src/command/cmd_defs.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/command/cmd_defs.c b/src/command/cmd_defs.c
index 982d81f6..db719b17 100644
--- a/src/command/cmd_defs.c
+++ b/src/command/cmd_defs.c
@@ -2367,6 +2367,7 @@ static struct cmd_t command_defs[] =
         CMD_NOSUBFUNCS
         CMD_MAINFUNC(cmd_correction)
         CMD_TAGS(
+            CMD_TAG_UI,
             CMD_TAG_CHAT,
             CMD_TAG_GROUPCHAT)
         CMD_SYN(
@@ -2379,6 +2380,22 @@ static struct cmd_t command_defs[] =
             { "char",    "Set character that will prefix corrected messages. Default: +"})
         CMD_NOEXAMPLES
     },
+
+    { "/correct",
+        parse_args, 1, 1, NULL,
+        CMD_NOSUBFUNCS
+        CMD_MAINFUNC(cmd_correct)
+        CMD_TAGS(
+            CMD_TAG_CHAT,
+            CMD_TAG_GROUPCHAT)
+        CMD_SYN(
+            "/correct <message>")
+        CMD_DESC(
+            "Correct and resend the last message (XEP-0308).")
+        CMD_ARGS(
+            { "<message>",    "The corrected message."})
+        CMD_NOEXAMPLES
+    },
 };
 
 static GHashTable *search_index;