about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/command/cmd_ac.c23
-rw-r--r--src/command/cmd_defs.c18
-rw-r--r--src/ui/console.c6
-rw-r--r--src/ui/ui.h1
4 files changed, 48 insertions, 0 deletions
diff --git a/src/command/cmd_ac.c b/src/command/cmd_ac.c
index 5b61da6a..0b411bcb 100644
--- a/src/command/cmd_ac.c
+++ b/src/command/cmd_ac.c
@@ -113,6 +113,7 @@ static char* _status_autocomplete(ProfWin *window, const char *const input, gboo
 static char* _logging_autocomplete(ProfWin *window, const char *const input, gboolean previous);
 static char* _color_autocomplete(ProfWin *window, const char *const input, gboolean previous);
 static char* _avatar_autocomplete(ProfWin *window, const char *const input, gboolean previous);
+static char* _correction_autocomplete(ProfWin *window, const char *const input, gboolean previous);
 
 static char* _script_autocomplete_func(const char *const prefix, gboolean previous, void *context);
 
@@ -234,6 +235,7 @@ static Autocomplete status_ac;
 static Autocomplete status_state_ac;
 static Autocomplete logging_ac;
 static Autocomplete color_ac;
+static Autocomplete correction_ac;
 
 void
 cmd_ac_init(void)
@@ -928,6 +930,11 @@ cmd_ac_init(void)
     autocomplete_add(color_ac, "off");
     autocomplete_add(color_ac, "redgreen");
     autocomplete_add(color_ac, "blue");
+
+    correction_ac = autocomplete_new();
+    autocomplete_add(correction_ac, "on");
+    autocomplete_add(correction_ac, "off");
+    autocomplete_add(correction_ac, "char");
 }
 
 void
@@ -1233,6 +1240,7 @@ cmd_ac_reset(ProfWin *window)
     autocomplete_reset(status_state_ac);
     autocomplete_reset(logging_ac);
     autocomplete_reset(color_ac);
+    autocomplete_reset(correction_ac);
 
     autocomplete_reset(script_ac);
     if (script_show_ac) {
@@ -1380,6 +1388,7 @@ cmd_ac_uninit(void)
     autocomplete_free(status_state_ac);
     autocomplete_free(logging_ac);
     autocomplete_free(color_ac);
+    autocomplete_free(correction_ac);
 }
 
 static void
@@ -1630,6 +1639,7 @@ _cmd_ac_complete_params(ProfWin *window, const char *const input, gboolean previ
     g_hash_table_insert(ac_funcs, "/logging",       _logging_autocomplete);
     g_hash_table_insert(ac_funcs, "/color",         _color_autocomplete);
     g_hash_table_insert(ac_funcs, "/avatar",        _avatar_autocomplete);
+    g_hash_table_insert(ac_funcs, "/correction",    _correction_autocomplete);
 
     int len = strlen(input);
     char parsed[len+1];
@@ -3713,3 +3723,16 @@ _avatar_autocomplete(ProfWin *window, const char *const input, gboolean previous
 
     return NULL;
 }
+
+static char*
+_correction_autocomplete(ProfWin *window, const char *const input, gboolean previous)
+{
+    char *result = NULL;
+
+    result = autocomplete_param_with_ac(input, "/correction", correction_ac, TRUE, previous);
+    if (result) {
+        return result;
+    }
+
+    return NULL;
+}
diff --git a/src/command/cmd_defs.c b/src/command/cmd_defs.c
index b583a06b..30e11990 100644
--- a/src/command/cmd_defs.c
+++ b/src/command/cmd_defs.c
@@ -2361,6 +2361,24 @@ static struct cmd_t command_defs[] =
             { "on|off", ""})
         CMD_NOEXAMPLES
     },
+
+    { "/correction",
+        parse_args, 1, 1, &cons_correction_setting,
+        CMD_NOSUBFUNCS
+        CMD_MAINFUNC(cmd_os)
+        CMD_TAGS(
+            CMD_TAG_CHAT,
+            CMD_TAG_GROUPCHAT)
+        CMD_SYN(
+            "/correction <on>|<off>",
+            "/correction char <char>")
+        CMD_DESC(
+            "Settings regarding Last Message Correction (XEP-0308).")
+        CMD_ARGS(
+            { "on|off", "Enable/Disable support for last message correction."},
+            { "char",    "Set character that will prefix corrected messages. Default: +"})
+        CMD_NOEXAMPLES
+    },
 };
 
 static GHashTable *search_index;
diff --git a/src/ui/console.c b/src/ui/console.c
index 1a716a7a..57a04290 100644
--- a/src/ui/console.c
+++ b/src/ui/console.c
@@ -2022,6 +2022,12 @@ cons_os_setting(void)
 }
 
 void
+cons_correction_setting(void)
+{
+    cons_show("TODO");
+}
+
+void
 cons_show_connection_prefs(void)
 {
     cons_show("Connection preferences:");
diff --git a/src/ui/ui.h b/src/ui/ui.h
index 4783131e..e8d42410 100644
--- a/src/ui/ui.h
+++ b/src/ui/ui.h
@@ -319,6 +319,7 @@ void cons_statusbar_setting(void);
 void cons_winpos_setting(void);
 void cons_color_setting(void);
 void cons_os_setting(void);
+void cons_correction_setting(void);
 void cons_show_contact_online(PContact contact, Resource *resource, GDateTime *last_activity);
 void cons_show_contact_offline(PContact contact, char *resource, char *status);
 void cons_theme_properties(void);
> 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535