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-14 11:09:45 +0100
committerGitHub <noreply@github.com>2020-02-14 11:09:45 +0100
commitc995f3150e8582907c749968e2c0c8b1022a43c1 (patch)
treeb8c0dd70d0a260b289400473eee909b3fffc45ea /src/command/cmd_defs.c
parent968006e1ddf97b5d9e8245c9dabbb0cfcfca2c3a (diff)
parent4241917fbaa7da4c108236eaec27fdfff84d72fe (diff)
downloadprofani-tty-c995f3150e8582907c749968e2c0c8b1022a43c1.tar.gz
Merge pull request #1267 from profanity-im/feature/xep-0308-lmc
XEP-0308 Last Message Correction
Diffstat (limited to 'src/command/cmd_defs.c')
-rw-r--r--src/command/cmd_defs.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/command/cmd_defs.c b/src/command/cmd_defs.c
index b583a06b..cc8f0a7a 100644
--- a/src/command/cmd_defs.c
+++ b/src/command/cmd_defs.c
@@ -2361,6 +2361,41 @@ static struct cmd_t command_defs[] =
             { "on|off", ""})
         CMD_NOEXAMPLES
     },
+
+    { "/correction",
+        parse_args, 1, 2, &cons_correction_setting,
+        CMD_NOSUBFUNCS
+        CMD_MAINFUNC(cmd_correction)
+        CMD_TAGS(
+            CMD_TAG_UI,
+            CMD_TAG_CHAT,
+            CMD_TAG_GROUPCHAT)
+        CMD_SYN(
+            "/correction <on>|<off>",
+            "/correction char <char>")
+        CMD_DESC(
+            "Settings regarding Last Message Correction (XEP-0308). Caution: We do not yet check the 'from' field. So it could happen that someone else is overwriting the actual message.")
+        CMD_ARGS(
+            { "on|off", "Enable/Disable support for last message correction."},
+            { "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;