From 64b52da4064dffb4de83a8f95c43f6ee4eca9cf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sun, 4 Jul 2021 14:02:15 +0200 Subject: [PATCH] typing: add option typing.look.input_min_chars --- doc/de/includes/autogen_user_options.de.adoc | 6 ++++++ doc/en/includes/autogen_user_options.en.adoc | 6 ++++++ doc/fr/includes/autogen_user_options.fr.adoc | 6 ++++++ doc/it/includes/autogen_user_options.it.adoc | 6 ++++++ doc/ja/includes/autogen_user_options.ja.adoc | 6 ++++++ doc/pl/includes/autogen_user_options.pl.adoc | 6 ++++++ doc/sr/includes/autogen_user_options.sr.adoc | 6 ++++++ po/cs.po | 5 ++++- po/de.po | 5 ++++- po/es.po | 5 ++++- po/fr.po | 9 +++++++-- po/hu.po | 5 ++++- po/it.po | 5 ++++- po/ja.po | 5 ++++- po/pl.po | 5 ++++- po/pt.po | 5 ++++- po/pt_BR.po | 5 ++++- po/ru.po | 5 ++++- po/sr.po | 5 ++++- po/tr.po | 5 ++++- po/weechat.pot | 5 ++++- src/plugins/typing/typing-config.c | 7 +++++++ src/plugins/typing/typing-config.h | 1 + src/plugins/typing/typing.c | 6 ++++-- 24 files changed, 113 insertions(+), 17 deletions(-) diff --git a/doc/de/includes/autogen_user_options.de.adoc b/doc/de/includes/autogen_user_options.de.adoc index 1b6aa914a..a612abb64 100644 --- a/doc/de/includes/autogen_user_options.de.adoc +++ b/doc/de/includes/autogen_user_options.de.adoc @@ -1876,6 +1876,12 @@ ** Werte: on, off ** Standardwert: `+off+` +* [[option_typing.look.input_min_chars]] *typing.look.input_min_chars* +** Beschreibung: pass:none[min number of chars in message to trigger send of typing signals] +** Typ: integer +** Werte: 1 .. 2147483647 +** Standardwert: `+4+` + * [[option_typing.look.item_max_length]] *typing.look.item_max_length* ** Beschreibung: pass:none[max number of chars displayed in the bar item "typing" (0 = do not truncate content)] ** Typ: integer diff --git a/doc/en/includes/autogen_user_options.en.adoc b/doc/en/includes/autogen_user_options.en.adoc index 20b0dac45..433dab18d 100644 --- a/doc/en/includes/autogen_user_options.en.adoc +++ b/doc/en/includes/autogen_user_options.en.adoc @@ -1876,6 +1876,12 @@ ** values: on, off ** default value: `+off+` +* [[option_typing.look.input_min_chars]] *typing.look.input_min_chars* +** description: pass:none[min number of chars in message to trigger send of typing signals] +** type: integer +** values: 1 .. 2147483647 +** default value: `+4+` + * [[option_typing.look.item_max_length]] *typing.look.item_max_length* ** description: pass:none[max number of chars displayed in the bar item "typing" (0 = do not truncate content)] ** type: integer diff --git a/doc/fr/includes/autogen_user_options.fr.adoc b/doc/fr/includes/autogen_user_options.fr.adoc index ad754caaf..cbc42bae9 100644 --- a/doc/fr/includes/autogen_user_options.fr.adoc +++ b/doc/fr/includes/autogen_user_options.fr.adoc @@ -1876,6 +1876,12 @@ ** valeurs: on, off ** valeur par défaut: `+off+` +* [[option_typing.look.input_min_chars]] *typing.look.input_min_chars* +** description: pass:none[nombre minimum de caractères dans le message pour déclencher l'envoi des signaux typing] +** type: entier +** valeurs: 1 .. 2147483647 +** valeur par défaut: `+4+` + * [[option_typing.look.item_max_length]] *typing.look.item_max_length* ** description: pass:none[nombre maximum de caractères affichés dans l'objet de barre "typing" (0 = ne pas tronquer le contenu)] ** type: entier diff --git a/doc/it/includes/autogen_user_options.it.adoc b/doc/it/includes/autogen_user_options.it.adoc index 2092d980a..c4c42fa76 100644 --- a/doc/it/includes/autogen_user_options.it.adoc +++ b/doc/it/includes/autogen_user_options.it.adoc @@ -1876,6 +1876,12 @@ ** valori: on, off ** valore predefinito: `+off+` +* [[option_typing.look.input_min_chars]] *typing.look.input_min_chars* +** descrizione: pass:none[min number of chars in message to trigger send of typing signals] +** tipo: intero +** valori: 1 .. 2147483647 +** valore predefinito: `+4+` + * [[option_typing.look.item_max_length]] *typing.look.item_max_length* ** descrizione: pass:none[max number of chars displayed in the bar item "typing" (0 = do not truncate content)] ** tipo: intero diff --git a/doc/ja/includes/autogen_user_options.ja.adoc b/doc/ja/includes/autogen_user_options.ja.adoc index 633e10e60..d055e3cd4 100644 --- a/doc/ja/includes/autogen_user_options.ja.adoc +++ b/doc/ja/includes/autogen_user_options.ja.adoc @@ -1876,6 +1876,12 @@ ** 値: on, off ** デフォルト値: `+off+` +* [[option_typing.look.input_min_chars]] *typing.look.input_min_chars* +** 説明: pass:none[min number of chars in message to trigger send of typing signals] +** タイプ: 整数 +** 値: 1 .. 2147483647 +** デフォルト値: `+4+` + * [[option_typing.look.item_max_length]] *typing.look.item_max_length* ** 説明: pass:none[max number of chars displayed in the bar item "typing" (0 = do not truncate content)] ** タイプ: 整数 diff --git a/doc/pl/includes/autogen_user_options.pl.adoc b/doc/pl/includes/autogen_user_options.pl.adoc index 316901426..71d25b425 100644 --- a/doc/pl/includes/autogen_user_options.pl.adoc +++ b/doc/pl/includes/autogen_user_options.pl.adoc @@ -1876,6 +1876,12 @@ ** wartości: on, off ** domyślna wartość: `+off+` +* [[option_typing.look.input_min_chars]] *typing.look.input_min_chars* +** opis: pass:none[min number of chars in message to trigger send of typing signals] +** typ: liczba +** wartości: 1 .. 2147483647 +** domyślna wartość: `+4+` + * [[option_typing.look.item_max_length]] *typing.look.item_max_length* ** opis: pass:none[max number of chars displayed in the bar item "typing" (0 = do not truncate content)] ** typ: liczba diff --git a/doc/sr/includes/autogen_user_options.sr.adoc b/doc/sr/includes/autogen_user_options.sr.adoc index eb6a095f3..3f8a2d298 100644 --- a/doc/sr/includes/autogen_user_options.sr.adoc +++ b/doc/sr/includes/autogen_user_options.sr.adoc @@ -1876,6 +1876,12 @@ ** вредности: on, off ** подразумевана вредност: `+off+` +* [[option_typing.look.input_min_chars]] *typing.look.input_min_chars* +** опис: pass:none[min number of chars in message to trigger send of typing signals] +** тип: целобројна +** вредности: 1 .. 2147483647 +** подразумевана вредност: `+4+` + * [[option_typing.look.item_max_length]] *typing.look.item_max_length* ** опис: pass:none[max number of chars displayed in the bar item "typing" (0 = do not truncate content)] ** тип: целобројна diff --git a/po/cs.po b/po/cs.po index e5d6fdb2c..b9a561be2 100644 --- a/po/cs.po +++ b/po/cs.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2021-07-04 13:35+0200\n" +"POT-Creation-Date: 2021-07-04 14:01+0200\n" "PO-Revision-Date: 2021-05-25 18:28+0200\n" "Last-Translator: Ondřej Súkup \n" "Language-Team: weechat-dev \n" @@ -12848,6 +12848,9 @@ msgstr "" msgid "typing enabled for self messages (send typing info to other users)" msgstr "" +msgid "min number of chars in message to trigger send of typing signals" +msgstr "" + msgid "" "max number of chars displayed in the bar item \"typing\" (0 = do not " "truncate content)" diff --git a/po/de.po b/po/de.po index f3e1652f8..e616868a5 100644 --- a/po/de.po +++ b/po/de.po @@ -24,7 +24,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2021-07-04 13:35+0200\n" +"POT-Creation-Date: 2021-07-04 14:01+0200\n" "PO-Revision-Date: 2021-06-28 08:57+0200\n" "Last-Translator: Nils Görs \n" "Language-Team: German \n" @@ -15390,6 +15390,9 @@ msgstr "" msgid "typing enabled for self messages (send typing info to other users)" msgstr "" +msgid "min number of chars in message to trigger send of typing signals" +msgstr "" + msgid "" "max number of chars displayed in the bar item \"typing\" (0 = do not " "truncate content)" diff --git a/po/es.po b/po/es.po index 836ed2dd6..268a73900 100644 --- a/po/es.po +++ b/po/es.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2021-07-04 13:35+0200\n" +"POT-Creation-Date: 2021-07-04 14:01+0200\n" "PO-Revision-Date: 2021-05-25 18:28+0200\n" "Last-Translator: Elián Hanisch \n" "Language-Team: weechat-dev \n" @@ -13103,6 +13103,9 @@ msgstr "" msgid "typing enabled for self messages (send typing info to other users)" msgstr "" +msgid "min number of chars in message to trigger send of typing signals" +msgstr "" + msgid "" "max number of chars displayed in the bar item \"typing\" (0 = do not " "truncate content)" diff --git a/po/fr.po b/po/fr.po index 9dfb0f16b..ff5162dac 100644 --- a/po/fr.po +++ b/po/fr.po @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2021-07-04 13:35+0200\n" -"PO-Revision-Date: 2021-07-04 13:35+0200\n" +"POT-Creation-Date: 2021-07-04 14:01+0200\n" +"PO-Revision-Date: 2021-07-04 14:01+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" "Language: fr\n" @@ -15105,6 +15105,11 @@ msgstr "" "activer le statut d'écriture pour ses propres messages (envoyer " "l'information aux autres utilisateurs)" +msgid "min number of chars in message to trigger send of typing signals" +msgstr "" +"nombre minimum de caractères dans le message pour déclencher l'envoi des " +"signaux typing" + msgid "" "max number of chars displayed in the bar item \"typing\" (0 = do not " "truncate content)" diff --git a/po/hu.po b/po/hu.po index 5423b34a5..e6e4eae60 100644 --- a/po/hu.po +++ b/po/hu.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2021-07-04 13:35+0200\n" +"POT-Creation-Date: 2021-07-04 14:01+0200\n" "PO-Revision-Date: 2021-05-25 18:28+0200\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -12268,6 +12268,9 @@ msgstr "" msgid "typing enabled for self messages (send typing info to other users)" msgstr "" +msgid "min number of chars in message to trigger send of typing signals" +msgstr "" + msgid "" "max number of chars displayed in the bar item \"typing\" (0 = do not " "truncate content)" diff --git a/po/it.po b/po/it.po index fb667d015..a9975e072 100644 --- a/po/it.po +++ b/po/it.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2021-07-04 13:35+0200\n" +"POT-Creation-Date: 2021-07-04 14:01+0200\n" "PO-Revision-Date: 2021-05-25 18:28+0200\n" "Last-Translator: Esteban I. Ruiz Moreno \n" "Language-Team: weechat-dev \n" @@ -13291,6 +13291,9 @@ msgstr "" msgid "typing enabled for self messages (send typing info to other users)" msgstr "" +msgid "min number of chars in message to trigger send of typing signals" +msgstr "" + msgid "" "max number of chars displayed in the bar item \"typing\" (0 = do not " "truncate content)" diff --git a/po/ja.po b/po/ja.po index 02a5e0a01..2dcefcf1a 100644 --- a/po/ja.po +++ b/po/ja.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2021-07-04 13:35+0200\n" +"POT-Creation-Date: 2021-07-04 14:01+0200\n" "PO-Revision-Date: 2021-05-25 18:28+0200\n" "Last-Translator: AYANOKOUZI, Ryuunosuke \n" "Language-Team: Japanese \n" "Language-Team: Polish \n" @@ -14751,6 +14751,9 @@ msgstr "" msgid "typing enabled for self messages (send typing info to other users)" msgstr "" +msgid "min number of chars in message to trigger send of typing signals" +msgstr "" + msgid "" "max number of chars displayed in the bar item \"typing\" (0 = do not " "truncate content)" diff --git a/po/pt.po b/po/pt.po index 2c0c349ec..b5603f128 100644 --- a/po/pt.po +++ b/po/pt.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2021-07-04 13:35+0200\n" +"POT-Creation-Date: 2021-07-04 14:01+0200\n" "PO-Revision-Date: 2021-05-25 18:28+0200\n" "Last-Translator: Vasco Almeida \n" "Language-Team: Portuguese <>\n" @@ -14260,6 +14260,9 @@ msgstr "" msgid "typing enabled for self messages (send typing info to other users)" msgstr "" +msgid "min number of chars in message to trigger send of typing signals" +msgstr "" + msgid "" "max number of chars displayed in the bar item \"typing\" (0 = do not " "truncate content)" diff --git a/po/pt_BR.po b/po/pt_BR.po index 3d1b9e3be..5bf1fa277 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2021-07-04 13:35+0200\n" +"POT-Creation-Date: 2021-07-04 14:01+0200\n" "PO-Revision-Date: 2021-05-25 18:28+0200\n" "Last-Translator: Érico Nogueira \n" "Language-Team: weechat-dev \n" @@ -12757,6 +12757,9 @@ msgstr "" msgid "typing enabled for self messages (send typing info to other users)" msgstr "" +msgid "min number of chars in message to trigger send of typing signals" +msgstr "" + msgid "" "max number of chars displayed in the bar item \"typing\" (0 = do not " "truncate content)" diff --git a/po/ru.po b/po/ru.po index dcb5fefc6..e4237d5b2 100644 --- a/po/ru.po +++ b/po/ru.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2021-07-04 13:35+0200\n" +"POT-Creation-Date: 2021-07-04 14:01+0200\n" "PO-Revision-Date: 2021-05-25 18:28+0200\n" "Last-Translator: Aleksey V Zapparov AKA ixti \n" "Language-Team: weechat-dev \n" @@ -12306,6 +12306,9 @@ msgstr "" msgid "typing enabled for self messages (send typing info to other users)" msgstr "" +msgid "min number of chars in message to trigger send of typing signals" +msgstr "" + msgid "" "max number of chars displayed in the bar item \"typing\" (0 = do not " "truncate content)" diff --git a/po/sr.po b/po/sr.po index 276518780..ce6e25e45 100644 --- a/po/sr.po +++ b/po/sr.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2021-07-04 13:35+0200\n" +"POT-Creation-Date: 2021-07-04 14:01+0200\n" "PO-Revision-Date: 2021-06-03 15:15+0400\n" "Last-Translator: Ivan Pešić \n" "Language-Team: weechat-dev \n" @@ -14722,6 +14722,9 @@ msgstr "" msgid "typing enabled for self messages (send typing info to other users)" msgstr "" +msgid "min number of chars in message to trigger send of typing signals" +msgstr "" + msgid "" "max number of chars displayed in the bar item \"typing\" (0 = do not " "truncate content)" diff --git a/po/tr.po b/po/tr.po index f5c1bf6cb..8398f2a2b 100644 --- a/po/tr.po +++ b/po/tr.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2021-07-04 13:35+0200\n" +"POT-Creation-Date: 2021-07-04 14:01+0200\n" "PO-Revision-Date: 2021-05-25 18:28+0200\n" "Last-Translator: Emir SARI \n" "Language-Team: weechat-dev \n" @@ -11639,6 +11639,9 @@ msgstr "" msgid "typing enabled for self messages (send typing info to other users)" msgstr "" +msgid "min number of chars in message to trigger send of typing signals" +msgstr "" + msgid "" "max number of chars displayed in the bar item \"typing\" (0 = do not " "truncate content)" diff --git a/po/weechat.pot b/po/weechat.pot index 78c56d133..c1c98225e 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2021-07-04 13:35+0200\n" +"POT-Creation-Date: 2021-07-04 14:01+0200\n" "PO-Revision-Date: 2014-08-16 10:27+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" @@ -11094,6 +11094,9 @@ msgstr "" msgid "typing enabled for self messages (send typing info to other users)" msgstr "" +msgid "min number of chars in message to trigger send of typing signals" +msgstr "" + msgid "" "max number of chars displayed in the bar item \"typing\" (0 = do not " "truncate content)" diff --git a/src/plugins/typing/typing-config.c b/src/plugins/typing/typing-config.c index a0fda1128..368d8582a 100644 --- a/src/plugins/typing/typing-config.c +++ b/src/plugins/typing/typing-config.c @@ -41,6 +41,7 @@ struct t_config_option *typing_config_look_delay_purge_typing; struct t_config_option *typing_config_look_delay_set_paused; struct t_config_option *typing_config_look_enabled_nicks; struct t_config_option *typing_config_look_enabled_self; +struct t_config_option *typing_config_look_input_min_chars; struct t_config_option *typing_config_look_item_max_length; @@ -170,6 +171,12 @@ typing_config_init () NULL, NULL, NULL, &typing_config_change_enabled, NULL, NULL, NULL, NULL, NULL); + typing_config_look_input_min_chars = weechat_config_new_option ( + typing_config_file, ptr_section, + "input_min_chars", "integer", + N_("min number of chars in message to trigger send of typing signals"), + NULL, 1, INT_MAX, "4", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); typing_config_look_item_max_length = weechat_config_new_option ( typing_config_file, ptr_section, "item_max_length", "integer", diff --git a/src/plugins/typing/typing-config.h b/src/plugins/typing/typing-config.h index d78c091ce..d714145e5 100644 --- a/src/plugins/typing/typing-config.h +++ b/src/plugins/typing/typing-config.h @@ -27,6 +27,7 @@ extern struct t_config_option *typing_config_look_delay_purge_typing; extern struct t_config_option *typing_config_look_delay_set_paused; extern struct t_config_option *typing_config_look_enabled_nicks; extern struct t_config_option *typing_config_look_enabled_self; +extern struct t_config_option *typing_config_look_input_min_chars; extern struct t_config_option *typing_config_look_item_max_length; extern int typing_config_init (); diff --git a/src/plugins/typing/typing.c b/src/plugins/typing/typing.c index 003863228..d27fce1d7 100644 --- a/src/plugins/typing/typing.c +++ b/src/plugins/typing/typing.c @@ -102,7 +102,7 @@ typing_input_text_changed_signal_cb (const void *pointer, void *data, const char *signal, const char *type_data, void *signal_data) { - int text_search; + int text_search, input_valid; const char *ptr_input, *ptr_input_for_buffer; struct t_gui_buffer *ptr_buffer; struct t_typing_status *ptr_typing_status; @@ -121,8 +121,10 @@ typing_input_text_changed_signal_cb (const void *pointer, void *data, return WEECHAT_RC_OK; ptr_input = weechat_buffer_get_string (ptr_buffer, "input"); + input_valid = (ptr_input && ptr_input[0]) ? + weechat_utf8_strlen (ptr_input) >= weechat_config_integer (typing_config_look_input_min_chars) : 0; - if (ptr_input && ptr_input[0]) + if (input_valid) { /* input is a command? ignore it */ ptr_input_for_buffer = weechat_string_input_for_buffer (ptr_input);