From 947f73bd506deec427e7393c6e2c696424415780 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sat, 19 Jun 2021 14:52:41 +0200 Subject: [PATCH] irc: add option irc.look.display_account_message (issue #320) --- ChangeLog.adoc | 2 +- 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 | 6 +++++- po/de.po | 6 +++++- po/es.po | 6 +++++- po/fr.po | 10 ++++++++-- po/hu.po | 6 +++++- po/it.po | 6 +++++- po/ja.po | 6 +++++- po/pl.po | 6 +++++- po/pt.po | 6 +++++- po/pt_BR.po | 6 +++++- po/ru.po | 6 +++++- po/sr.po | 6 +++++- po/tr.po | 6 +++++- po/weechat.pot | 6 +++++- src/plugins/irc/irc-config.c | 8 ++++++++ src/plugins/irc/irc-config.h | 1 + src/plugins/irc/irc-protocol.c | 3 ++- 25 files changed, 127 insertions(+), 17 deletions(-) diff --git a/ChangeLog.adoc b/ChangeLog.adoc index 242b14995..6d1efdb4e 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -21,7 +21,7 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] New features:: * core: add option "certs" in command /debug - * irc: add option irc.look.display_extended_join (issue #320) + * irc: add options irc.look.display_account_message and irc.look.display_extended_join (issue #320) * irc: add command /setname, add support of message and capability "setname" (issue #1653) * irc: always set realname in nicks even when extended-join capability is not enabled (issue #1653) * irc: add support of FAIL/WARN/NOTE messages (issue #1653) diff --git a/doc/de/includes/autogen_user_options.de.adoc b/doc/de/includes/autogen_user_options.de.adoc index 6aa24172e..882ae0feb 100644 --- a/doc/de/includes/autogen_user_options.de.adoc +++ b/doc/de/includes/autogen_user_options.de.adoc @@ -2214,6 +2214,12 @@ ** Werte: beliebige Zeichenkette ** Standardwert: `+"%a, %d %b %Y %T %z"+` +* [[option_irc.look.display_account_message]] *irc.look.display_account_message* +** Beschreibung: pass:none[display ACCOUNT messages received when capability account-notify is enabled] +** Typ: boolesch +** Werte: on, off +** Standardwert: `+on+` + * [[option_irc.look.display_away]] *irc.look.display_away* ** Beschreibung: pass:none[zeigt eine Nachricht an, sobald der Abwesenheitsstatus ein- bzw. ausgeschaltet wird (off: zeigt/sendet keine Nachricht, local: eine Nachricht wird lokal angezeigt, channel: sendet eine Nachricht an die Kanäle)] ** Typ: integer diff --git a/doc/en/includes/autogen_user_options.en.adoc b/doc/en/includes/autogen_user_options.en.adoc index ec7de407c..6f2eb6d80 100644 --- a/doc/en/includes/autogen_user_options.en.adoc +++ b/doc/en/includes/autogen_user_options.en.adoc @@ -2214,6 +2214,12 @@ ** values: any string ** default value: `+"%a, %d %b %Y %T %z"+` +* [[option_irc.look.display_account_message]] *irc.look.display_account_message* +** description: pass:none[display ACCOUNT messages received when capability account-notify is enabled] +** type: boolean +** values: on, off +** default value: `+on+` + * [[option_irc.look.display_away]] *irc.look.display_away* ** description: pass:none[display message when (un)marking as away (off: do not display/send anything, local: display locally, channel: send action to channels)] ** type: integer diff --git a/doc/fr/includes/autogen_user_options.fr.adoc b/doc/fr/includes/autogen_user_options.fr.adoc index d8a6d96dc..db5508e3d 100644 --- a/doc/fr/includes/autogen_user_options.fr.adoc +++ b/doc/fr/includes/autogen_user_options.fr.adoc @@ -2214,6 +2214,12 @@ ** valeurs: toute chaîne ** valeur par défaut: `+"%a, %d %b %Y %T %z"+` +* [[option_irc.look.display_account_message]] *irc.look.display_account_message* +** description: pass:none[afficher les messages ACCOUNT reçus quand la capacité account-notify est activée] +** type: booléen +** valeurs: on, off +** valeur par défaut: `+on+` + * [[option_irc.look.display_away]] *irc.look.display_away* ** description: pass:none[afficher un message pour l'absence/retour (off : ne rien afficher/envoyer, local : afficher en local, channel : envoyer l'action aux canaux)] ** type: entier diff --git a/doc/it/includes/autogen_user_options.it.adoc b/doc/it/includes/autogen_user_options.it.adoc index 3429276ed..83b2fd0a1 100644 --- a/doc/it/includes/autogen_user_options.it.adoc +++ b/doc/it/includes/autogen_user_options.it.adoc @@ -2214,6 +2214,12 @@ ** valori: qualsiasi stringa ** valore predefinito: `+"%a, %d %b %Y %T %z"+` +* [[option_irc.look.display_account_message]] *irc.look.display_account_message* +** descrizione: pass:none[display ACCOUNT messages received when capability account-notify is enabled] +** tipo: bool +** valori: on, off +** valore predefinito: `+on+` + * [[option_irc.look.display_away]] *irc.look.display_away* ** descrizione: pass:none[mostra messaggio quando (non) si risulta assenti (off: non mostra/invia nulla, local: mostra localmente, channel: invia azioni ai canali)] ** tipo: intero diff --git a/doc/ja/includes/autogen_user_options.ja.adoc b/doc/ja/includes/autogen_user_options.ja.adoc index e68e6ceab..05552ae2e 100644 --- a/doc/ja/includes/autogen_user_options.ja.adoc +++ b/doc/ja/includes/autogen_user_options.ja.adoc @@ -2214,6 +2214,12 @@ ** 値: 未制約文字列 ** デフォルト値: `+"%a, %d %b %Y %T %z"+` +* [[option_irc.look.display_account_message]] *irc.look.display_account_message* +** 説明: pass:none[display ACCOUNT messages received when capability account-notify is enabled] +** タイプ: ブール +** 値: on, off +** デフォルト値: `+on+` + * [[option_irc.look.display_away]] *irc.look.display_away* ** 説明: pass:none[離席状態が変更されたらメッセージを表示 (off: 何も表示/送信しない、local: ローカルに表示、channel: チャンネルにアクションを送信)] ** タイプ: 整数 diff --git a/doc/pl/includes/autogen_user_options.pl.adoc b/doc/pl/includes/autogen_user_options.pl.adoc index a4a8b6a69..29bfc5e51 100644 --- a/doc/pl/includes/autogen_user_options.pl.adoc +++ b/doc/pl/includes/autogen_user_options.pl.adoc @@ -2214,6 +2214,12 @@ ** wartości: dowolny ciąg ** domyślna wartość: `+"%a, %d %b %Y %T %z"+` +* [[option_irc.look.display_account_message]] *irc.look.display_account_message* +** opis: pass:none[display ACCOUNT messages received when capability account-notify is enabled] +** typ: bool +** wartości: on, off +** domyślna wartość: `+on+` + * [[option_irc.look.display_away]] *irc.look.display_away* ** opis: pass:none[wyświetl wiadomość, kiedy w(y)łączamy tryb oddalenia (off: nie wyświetlaj/wysyłaj nic, local: wyświetl lokalnie, channel: wyślij akcję na kanały)] ** typ: liczba diff --git a/doc/sr/includes/autogen_user_options.sr.adoc b/doc/sr/includes/autogen_user_options.sr.adoc index 87e72ab67..30a210f1a 100644 --- a/doc/sr/includes/autogen_user_options.sr.adoc +++ b/doc/sr/includes/autogen_user_options.sr.adoc @@ -2214,6 +2214,12 @@ ** вредности: било који стринг ** подразумевана вредност: `+"%a, %d %b %Y %T %z"+` +* [[option_irc.look.display_account_message]] *irc.look.display_account_message* +** опис: pass:none[display ACCOUNT messages received when capability account-notify is enabled] +** тип: логичка +** вредности: on, off +** подразумевана вредност: `+on+` + * [[option_irc.look.display_away]] *irc.look.display_away* ** опис: pass:none[приказ поруке када се (де)маркира као одсутан (off: не приказује/шаље се ништа, local: приказује се локално, channel: слање акције каналу)] ** тип: целобројна diff --git a/po/cs.po b/po/cs.po index 304c7a217..c663de9a4 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-06-19 18:07+0200\n" +"POT-Creation-Date: 2021-06-19 18:12+0200\n" "PO-Revision-Date: 2021-05-25 18:28+0200\n" "Last-Translator: Ondřej Súkup \n" "Language-Team: weechat-dev \n" @@ -8342,6 +8342,10 @@ msgstr "" "časový formát pro \"time\" položku panelu (viz. man strftime pro specifikaci " "data/času)" +msgid "" +"display ACCOUNT messages received when capability account-notify is enabled" +msgstr "" + msgid "" "display message when (un)marking as away (off: do not display/send anything, " "local: display locally, channel: send action to channels)" diff --git a/po/de.po b/po/de.po index fb53dd184..81692b040 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-06-19 18:07+0200\n" +"POT-Creation-Date: 2021-06-19 18:12+0200\n" "PO-Revision-Date: 2021-06-18 08:35+0200\n" "Last-Translator: Nils Görs \n" "Language-Team: German \n" @@ -10269,6 +10269,10 @@ msgstr "" "wird (siehe man strftime, welche Platzhalter für das Datum und die Uhrzeit " "verwendet werden)" +msgid "" +"display ACCOUNT messages received when capability account-notify is enabled" +msgstr "" + msgid "" "display message when (un)marking as away (off: do not display/send anything, " "local: display locally, channel: send action to channels)" diff --git a/po/es.po b/po/es.po index a2f3d0c39..0ddd98cd1 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-06-19 18:07+0200\n" +"POT-Creation-Date: 2021-06-19 18:12+0200\n" "PO-Revision-Date: 2021-05-25 18:28+0200\n" "Last-Translator: Elián Hanisch \n" "Language-Team: weechat-dev \n" @@ -8588,6 +8588,10 @@ msgstr "" "formato de hora usado en respuesta al mensaje CTCP TIME (consultar man " "strftime para las especificaciones de fecha/hora)" +msgid "" +"display ACCOUNT messages received when capability account-notify is enabled" +msgstr "" + msgid "" "display message when (un)marking as away (off: do not display/send anything, " "local: display locally, channel: send action to channels)" diff --git a/po/fr.po b/po/fr.po index 371abc3f6..d9ea305d0 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-06-19 18:07+0200\n" -"PO-Revision-Date: 2021-06-19 18:08+0200\n" +"POT-Creation-Date: 2021-06-19 18:12+0200\n" +"PO-Revision-Date: 2021-06-19 18:13+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" "Language: fr\n" @@ -10069,6 +10069,12 @@ msgstr "" "format de date/heure utilisé pour la réponse au message CTCP TIME (voir man " "strftime pour le format de date/heure)" +msgid "" +"display ACCOUNT messages received when capability account-notify is enabled" +msgstr "" +"afficher les messages ACCOUNT reçus quand la capacité account-notify est " +"activée" + msgid "" "display message when (un)marking as away (off: do not display/send anything, " "local: display locally, channel: send action to channels)" diff --git a/po/hu.po b/po/hu.po index 991c4215c..6ea23791a 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-06-19 18:07+0200\n" +"POT-Creation-Date: 2021-06-19 18:12+0200\n" "PO-Revision-Date: 2021-05-25 18:28+0200\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -7933,6 +7933,10 @@ msgid "" "time specifiers)" msgstr "" +msgid "" +"display ACCOUNT messages received when capability account-notify is enabled" +msgstr "" + msgid "" "display message when (un)marking as away (off: do not display/send anything, " "local: display locally, channel: send action to channels)" diff --git a/po/it.po b/po/it.po index ab46141f2..b8b8b72dd 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-06-19 18:07+0200\n" +"POT-Creation-Date: 2021-06-19 18:12+0200\n" "PO-Revision-Date: 2021-05-25 18:28+0200\n" "Last-Translator: Esteban I. Ruiz Moreno \n" "Language-Team: weechat-dev \n" @@ -8729,6 +8729,10 @@ msgstr "" "formato dell'ora in risposta al messaggio CTCP TIME (consultare man strftime " "per i dettagli su data/ora)" +msgid "" +"display ACCOUNT messages received when capability account-notify is enabled" +msgstr "" + msgid "" "display message when (un)marking as away (off: do not display/send anything, " "local: display locally, channel: send action to channels)" diff --git a/po/ja.po b/po/ja.po index c61e3689e..6c6f9fab0 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-06-19 18:07+0200\n" +"POT-Creation-Date: 2021-06-19 18:12+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" @@ -9892,6 +9892,10 @@ msgstr "" "format czasu używany w odpowiedzi na wiadomość CTCP TIME (zobacz man " "strftime dla specyfikatorów daty/czasu)" +msgid "" +"display ACCOUNT messages received when capability account-notify is enabled" +msgstr "" + msgid "" "display message when (un)marking as away (off: do not display/send anything, " "local: display locally, channel: send action to channels)" diff --git a/po/pt.po b/po/pt.po index 32966d750..13509c26a 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-06-19 18:07+0200\n" +"POT-Creation-Date: 2021-06-19 18:12+0200\n" "PO-Revision-Date: 2021-05-25 18:28+0200\n" "Last-Translator: Vasco Almeida \n" "Language-Team: Portuguese <>\n" @@ -9413,6 +9413,10 @@ msgstr "" "formato de data/hora usado para responder a mensagens CTCP (ver man strftime " "para especificadores de data/hora)" +msgid "" +"display ACCOUNT messages received when capability account-notify is enabled" +msgstr "" + msgid "" "display message when (un)marking as away (off: do not display/send anything, " "local: display locally, channel: send action to channels)" diff --git a/po/pt_BR.po b/po/pt_BR.po index 09d794546..1f9d948cb 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-06-19 18:07+0200\n" +"POT-Creation-Date: 2021-06-19 18:12+0200\n" "PO-Revision-Date: 2021-05-25 18:28+0200\n" "Last-Translator: Érico Nogueira \n" "Language-Team: weechat-dev \n" @@ -8372,6 +8372,10 @@ msgstr "" "formato de tempo para o item de barra \"time\" (veja man strftime para " "especificadores de data/tempo)" +msgid "" +"display ACCOUNT messages received when capability account-notify is enabled" +msgstr "" + msgid "" "display message when (un)marking as away (off: do not display/send anything, " "local: display locally, channel: send action to channels)" diff --git a/po/ru.po b/po/ru.po index abc245cef..06a120555 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-06-19 18:07+0200\n" +"POT-Creation-Date: 2021-06-19 18:12+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" @@ -7966,6 +7966,10 @@ msgid "" "time specifiers)" msgstr "" +msgid "" +"display ACCOUNT messages received when capability account-notify is enabled" +msgstr "" + msgid "" "display message when (un)marking as away (off: do not display/send anything, " "local: display locally, channel: send action to channels)" diff --git a/po/sr.po b/po/sr.po index 5171505a5..0b6566e2a 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-06-19 18:07+0200\n" +"POT-Creation-Date: 2021-06-19 18:12+0200\n" "PO-Revision-Date: 2021-06-03 15:15+0400\n" "Last-Translator: Ivan Pešić \n" "Language-Team: weechat-dev \n" @@ -9874,6 +9874,10 @@ msgstr "" "формат времена који се користи у одговору на CTCP поруку TIME (погледајте " "man strftime за спецификаторе датума/времена)" +msgid "" +"display ACCOUNT messages received when capability account-notify is enabled" +msgstr "" + msgid "" "display message when (un)marking as away (off: do not display/send anything, " "local: display locally, channel: send action to channels)" diff --git a/po/tr.po b/po/tr.po index 0f6423518..90d63e3b0 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-06-19 18:07+0200\n" +"POT-Creation-Date: 2021-06-19 18:12+0200\n" "PO-Revision-Date: 2021-05-25 18:28+0200\n" "Last-Translator: Emir SARI \n" "Language-Team: weechat-dev \n" @@ -7590,6 +7590,10 @@ msgid "" "time specifiers)" msgstr "" +msgid "" +"display ACCOUNT messages received when capability account-notify is enabled" +msgstr "" + msgid "" "display message when (un)marking as away (off: do not display/send anything, " "local: display locally, channel: send action to channels)" diff --git a/po/weechat.pot b/po/weechat.pot index 28fbc2ede..6a0cdc8ee 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-06-19 18:07+0200\n" +"POT-Creation-Date: 2021-06-19 18:12+0200\n" "PO-Revision-Date: 2014-08-16 10:27+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" @@ -7060,6 +7060,10 @@ msgid "" "time specifiers)" msgstr "" +msgid "" +"display ACCOUNT messages received when capability account-notify is enabled" +msgstr "" + msgid "" "display message when (un)marking as away (off: do not display/send anything, " "local: display locally, channel: send action to channels)" diff --git a/src/plugins/irc/irc-config.c b/src/plugins/irc/irc-config.c index 5c2bee6d2..353621e46 100644 --- a/src/plugins/irc/irc-config.c +++ b/src/plugins/irc/irc-config.c @@ -59,6 +59,7 @@ struct t_config_option *irc_config_look_color_nicks_in_nicklist; struct t_config_option *irc_config_look_color_nicks_in_server_messages; struct t_config_option *irc_config_look_color_pv_nick_like_channel; struct t_config_option *irc_config_look_ctcp_time_format; +struct t_config_option *irc_config_look_display_account_message; struct t_config_option *irc_config_look_display_away; struct t_config_option *irc_config_look_display_ctcp_blocked; struct t_config_option *irc_config_look_display_ctcp_reply; @@ -2789,6 +2790,13 @@ irc_config_init () "for date/time specifiers)"), NULL, 0, 0, "%a, %d %b %Y %T %z", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_display_account_message = weechat_config_new_option ( + irc_config_file, ptr_section, + "display_account_message", "boolean", + N_("display ACCOUNT messages received when capability account-notify " + "is enabled"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); irc_config_look_display_away = weechat_config_new_option ( irc_config_file, ptr_section, "display_away", "integer", diff --git a/src/plugins/irc/irc-config.h b/src/plugins/irc/irc-config.h index d4f5c391b..25c17319b 100644 --- a/src/plugins/irc/irc-config.h +++ b/src/plugins/irc/irc-config.h @@ -99,6 +99,7 @@ extern struct t_config_option *irc_config_look_color_nicks_in_nicklist; extern struct t_config_option *irc_config_look_color_nicks_in_server_messages; extern struct t_config_option *irc_config_look_color_pv_nick_like_channel; extern struct t_config_option *irc_config_look_ctcp_time_format; +extern struct t_config_option *irc_config_look_display_account_message; extern struct t_config_option *irc_config_look_display_away; extern struct t_config_option *irc_config_look_display_ctcp_blocked; extern struct t_config_option *irc_config_look_display_ctcp_reply; diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index 2a7393fd1..40e49adcc 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -409,7 +409,8 @@ IRC_PROTOCOL_CALLBACK(account) ptr_nick = irc_nick_search (server, ptr_channel, nick); if (ptr_nick) { - if (!ignored) + if (!ignored + && weechat_config_boolean (irc_config_look_display_account_message)) { ptr_nick_speaking = ((weechat_config_boolean (irc_config_look_smart_filter)) && (weechat_config_boolean (irc_config_look_smart_filter_account))) ?