]> jfr.im git - irc/weechat/weechat.git/commitdiff
irc: add option irc.look.open_pv_buffer_echo_msg (issue #2016)
authorSébastien Helleu <redacted>
Thu, 14 Sep 2023 18:22:43 +0000 (20:22 +0200)
committerSébastien Helleu <redacted>
Thu, 14 Sep 2023 18:22:43 +0000 (20:22 +0200)
19 files changed:
ChangeLog.adoc
po/cs.po
po/de.po
po/es.po
po/fr.po
po/hu.po
po/it.po
po/ja.po
po/pl.po
po/pt.po
po/pt_BR.po
po/ru.po
po/sr.po
po/tr.po
po/weechat.pot
src/plugins/irc/irc-config.c
src/plugins/irc/irc-config.h
src/plugins/irc/irc-protocol.c
tests/unit/plugins/irc/test-irc-protocol.cpp

index ac1377b576d65d84072285a477faac13308c2b22..5dc8b27425f2ece3c56ba68482a56e04a405a735 100644 (file)
@@ -21,7 +21,7 @@ New features::
 
 Bug fixes::
 
-  * irc: don't open a new private buffer on `/msg` command when capability echo-message is enabled (issue #2016)
+  irc: add option irc.look.open_pv_buffer_echo_msg to open private buffer on self message when capability echo-message is enabled (issue #2016)
   * irc: fix title of private buffers wrongly set to own address when capability echo-message is enabled (issue #2016)
   * irc: fix autojoin of channels when private buffers are opened (issue #2012)
   * irc: fix string comparison when CASEMAPPING is set to "ascii"
index c1e7c389f019568bcac788bff17e5edcfa69ec17..c9509ce573613033145ea04d915033f52ceb9bd5 100644 (file)
--- 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: 2023-09-12 15:10+0200\n"
+"POT-Creation-Date: 2023-09-14 20:21+0200\n"
 "PO-Revision-Date: 2023-06-25 00:48+0200\n"
 "Last-Translator: Ondřej Súkup <mimi.vx@gmail.com>\n"
 "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -9223,6 +9223,10 @@ msgstr ""
 "když se změní status nepřítomnosti přezdívky (výsledek příkazu whois), "
 "například: \"notify_highlight\", \"notify_message\" or \"notify_private\""
 
+msgid ""
+"open a private buffer on self message when capability echo-message is enabled"
+msgstr ""
+
 msgid "close buffer when /part is issued on a channel"
 msgstr "zavřít buffer, když je na kanálu spuštěn /part"
 
index de36d6709ca63a5bc97156f95d558a63188b8112..84d90dfa0389028e16662a5e889aef5fdcdf3352 100644 (file)
--- a/po/de.po
+++ b/po/de.po
@@ -26,7 +26,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: WeeChat\n"
 "Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2023-09-12 15:10+0200\n"
+"POT-Creation-Date: 2023-09-14 20:21+0200\n"
 "PO-Revision-Date: 2023-07-05 21:25+0200\n"
 "Last-Translator: Nils Görs <weechatter@arcor.de>\n"
 "Language-Team: German <kde-i18n-de@kde.org>\n"
@@ -11460,6 +11460,10 @@ msgstr ""
 "(Rückgabe durch Befehl whois), zum Beispiel: \"notify_message\", "
 "\"notify_private\" oder \"notify_highlight\""
 
+msgid ""
+"open a private buffer on self message when capability echo-message is enabled"
+msgstr ""
+
 msgid "close buffer when /part is issued on a channel"
 msgstr "schließt den Buffer wenn \"/part\" im Kanal ausgeführt wird"
 
index 8a8e091e18540593aa1b0f671bc00852e2197df8..1ba743353fbbf52516c7a78ad53bcf856ffdf898 100644 (file)
--- 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: 2023-09-12 15:10+0200\n"
+"POT-Creation-Date: 2023-09-14 20:21+0200\n"
 "PO-Revision-Date: 2023-06-17 11:47+0200\n"
 "Last-Translator: Santiago Forero <santiago@forero.xyz>\n"
 "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -9922,6 +9922,10 @@ msgstr ""
 "cuando un apodo cambia su estado de ausencia (resultado del comando whois), "
 "por ejemplo: \"notify_highlight\", \"notify_message\" o \"notify_private\""
 
+msgid ""
+"open a private buffer on self message when capability echo-message is enabled"
+msgstr ""
+
 msgid "close buffer when /part is issued on a channel"
 msgstr "cerrar el buffer cuando /part es usado en un canal"
 
index 29cec3d03ce6311eeb98b51825b7fef7e9e9b9fd..a7c951876a873b7ddeb053a38cc70683653e033d 100644 (file)
--- 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: 2023-09-12 15:10+0200\n"
-"PO-Revision-Date: 2023-09-12 15:11+0200\n"
+"POT-Creation-Date: 2023-09-14 20:21+0200\n"
+"PO-Revision-Date: 2023-09-14 20:21+0200\n"
 "Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
 "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
 "Language: fr\n"
@@ -11242,6 +11242,12 @@ msgstr ""
 "de la commande whois), par exemple : \"notify_message\", \"notify_private\" "
 "ou \"notify_highlight\""
 
+msgid ""
+"open a private buffer on self message when capability echo-message is enabled"
+msgstr ""
+"ouvrir un tampon privé sur son propre message quand la capacité echo-message "
+"est activée"
+
 msgid "close buffer when /part is issued on a channel"
 msgstr "fermer le tampon lorsque /part est exécuté sur un canal"
 
index d91b6a488961c5aa3e96ba9a39ebf01ef2d1b5b6..606af70523d7499fb9f333e80cdc3bc434d8d1f4 100644 (file)
--- 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: 2023-09-12 15:10+0200\n"
+"POT-Creation-Date: 2023-09-14 20:21+0200\n"
 "PO-Revision-Date: 2023-06-17 11:47+0200\n"
 "Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
 "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -8680,6 +8680,10 @@ msgid ""
 "\"notify_message\", \"notify_private\" or \"notify_highlight\""
 msgstr ""
 
+msgid ""
+"open a private buffer on self message when capability echo-message is enabled"
+msgstr ""
+
 msgid "close buffer when /part is issued on a channel"
 msgstr ""
 
index fed5af908ae0ba63efbb0e78c517d616775612ed..1c515ef9685a8068e592b24bb020eba9ca2722de 100644 (file)
--- 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: 2023-09-12 15:10+0200\n"
+"POT-Creation-Date: 2023-09-14 20:21+0200\n"
 "PO-Revision-Date: 2023-06-17 11:47+0200\n"
 "Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n"
 "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -9647,6 +9647,10 @@ msgstr ""
 "whois), ad esempio: \"notify_message\", \"notify_private\" o "
 "\"notify_highlight\""
 
+msgid ""
+"open a private buffer on self message when capability echo-message is enabled"
+msgstr ""
+
 msgid "close buffer when /part is issued on a channel"
 msgstr "chiude buffer quando viene digitato /part nel canale"
 
index c1db2804190112071138517de80ae0005c8b3059..22fd90d4c03571d98d1797791ad51b60537ac9e4 100644 (file)
--- 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: 2023-09-12 15:10+0200\n"
+"POT-Creation-Date: 2023-09-14 20:21+0200\n"
 "PO-Revision-Date: 2023-06-17 11:47+0200\n"
 "Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n"
 "Language-Team: Japanese <https://github.com/l/weechat/tree/master/"
@@ -10827,6 +10827,10 @@ msgstr ""
 "よって表示されたメッセージに使われたタグのコンマ区切りリスト、例: "
 "\"notify_message\"、\"notify_private\"、\"notify_highlight\""
 
+msgid ""
+"open a private buffer on self message when capability echo-message is enabled"
+msgstr ""
+
 msgid "close buffer when /part is issued on a channel"
 msgstr "/part を実行した場合にバッファを閉じる"
 
index 3bec30afbe1cf47f3c98e78158bca225d78aab00..f5fdae4cf8535c95fd7931305863f8c3a30637a1 100644 (file)
--- a/po/pl.po
+++ b/po/pl.po
@@ -22,7 +22,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: WeeChat\n"
 "Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2023-09-12 15:10+0200\n"
+"POT-Creation-Date: 2023-09-14 20:21+0200\n"
 "PO-Revision-Date: 2023-06-17 11:47+0200\n"
 "Last-Translator: Krzysztof Korościk <soltys@soltys.info>\n"
 "Language-Team: Polish <kde-i18n-doc@kde.org>\n"
@@ -11823,6 +11823,10 @@ msgstr ""
 "komendy whois), na przykład: \"notify_message\", \"notify_private\" or "
 "\"notify_highlight\""
 
+msgid ""
+"open a private buffer on self message when capability echo-message is enabled"
+msgstr ""
+
 msgid "close buffer when /part is issued on a channel"
 msgstr "zamyka bufor, kiedy na kanale wykonamy /part"
 
index 405940be9688d9941386a3d172a080134eec5b37..e84a20bc8edf511a4fa7c06b55ba79b0accf9b0e 100644 (file)
--- 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: 2023-09-12 15:10+0200\n"
+"POT-Creation-Date: 2023-09-14 20:21+0200\n"
 "PO-Revision-Date: 2023-06-17 11:47+0200\n"
 "Last-Translator: Vasco Almeida <vascomalmeida@sapo.pt>\n"
 "Language-Team: Portuguese <>\n"
@@ -10594,6 +10594,10 @@ msgstr ""
 "whois), por exemplo: \"notify_message\", \"notify_private\" ou "
 "\"notify_highlight\""
 
+msgid ""
+"open a private buffer on self message when capability echo-message is enabled"
+msgstr ""
+
 msgid "close buffer when /part is issued on a channel"
 msgstr "fechar o buffer ao executar /part num canal"
 
index fbf208bf693e1606ddf9cf2749c0a3ef099192ed..a57139258b282bef6aa937ea0e4d1dd5077d5edc 100644 (file)
@@ -21,7 +21,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: WeeChat\n"
 "Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2023-09-12 15:10+0200\n"
+"POT-Creation-Date: 2023-09-14 20:21+0200\n"
 "PO-Revision-Date: 2023-06-17 11:47+0200\n"
 "Last-Translator: Érico Nogueira <ericonr@disroot.org>\n"
 "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -9225,6 +9225,10 @@ msgid ""
 "\"notify_message\", \"notify_private\" or \"notify_highlight\""
 msgstr ""
 
+msgid ""
+"open a private buffer on self message when capability echo-message is enabled"
+msgstr ""
+
 msgid "close buffer when /part is issued on a channel"
 msgstr "fechar buffer quando o comando /part é executado em um canal"
 
index fb45e5996a190694b945a269a918fea5be5dd1be..ae9de94ab2439a4d8f1e7204b5b1a1ab371e4d86 100644 (file)
--- 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: 2023-09-12 15:10+0200\n"
+"POT-Creation-Date: 2023-09-14 20:21+0200\n"
 "PO-Revision-Date: 2023-06-17 11:47+0200\n"
 "Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n"
 "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -8712,6 +8712,10 @@ msgid ""
 "\"notify_message\", \"notify_private\" or \"notify_highlight\""
 msgstr ""
 
+msgid ""
+"open a private buffer on self message when capability echo-message is enabled"
+msgstr ""
+
 msgid "close buffer when /part is issued on a channel"
 msgstr ""
 
index 1e12743d71968598a04a04eaefe741f474ca58d8..b5d8a1f21b33943de2604fd7b9efb207dec1ed7a 100644 (file)
--- 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: 2023-09-12 15:10+0200\n"
+"POT-Creation-Date: 2023-09-14 20:21+0200\n"
 "PO-Revision-Date: 2023-06-17 11:47+0200\n"
 "Last-Translator: Ivan Pešić <ivan.pesic@gmail.com>\n"
 "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -11028,6 +11028,10 @@ msgstr ""
 "се статус одсуства надимка промени (резултат команде whois), на пример: "
 "„notify_message”, „notify_private” или „notify_highlight”"
 
+msgid ""
+"open a private buffer on self message when capability echo-message is enabled"
+msgstr ""
+
 msgid "close buffer when /part is issued on a channel"
 msgstr "затварање бафера када се на каналу изврши /part"
 
index 72c8a563d5842b2fba46b56d86369a1e26ac7218..a084e60d79a59df37bacf1605e6389cc1862a513 100644 (file)
--- 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: 2023-09-12 15:10+0200\n"
+"POT-Creation-Date: 2023-09-14 20:21+0200\n"
 "PO-Revision-Date: 2023-06-17 11:47+0200\n"
 "Last-Translator: Emir SARI <emir_sari@icloud.com>\n"
 "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -11393,6 +11393,10 @@ msgstr ""
 "kullanılan etiketlerin virgülle ayrılmış listesi (komut whois'inin sonucu); "
 "örneğin: \"notify_message\", \"notify_private\" veya \"notify_highlight\""
 
+msgid ""
+"open a private buffer on self message when capability echo-message is enabled"
+msgstr ""
+
 msgid "close buffer when /part is issued on a channel"
 msgstr "bir kanalda /part verildiğinde arabelleği kapat"
 
index 3929215dddcbbd8aabd1cb986ae1b4e339e1d7fc..93b5c1792db0a0b3696107722f9e04bda000c11e 100644 (file)
@@ -21,7 +21,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: WeeChat\n"
 "Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2023-09-12 15:10+0200\n"
+"POT-Creation-Date: 2023-09-14 20:21+0200\n"
 "PO-Revision-Date: 2014-08-16 10:27+0200\n"
 "Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
 "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -7789,6 +7789,10 @@ msgid ""
 "\"notify_message\", \"notify_private\" or \"notify_highlight\""
 msgstr ""
 
+msgid ""
+"open a private buffer on self message when capability echo-message is enabled"
+msgstr ""
+
 msgid "close buffer when /part is issued on a channel"
 msgstr ""
 
index 0c40f86c761768f0a836710307afcd04290b40c3..79a054c0fbd5ed9470ba11112da93b30a7da3eee 100644 (file)
@@ -103,6 +103,7 @@ struct t_config_option *irc_config_look_notice_welcome_redirect = NULL;
 struct t_config_option *irc_config_look_notice_welcome_tags = NULL;
 struct t_config_option *irc_config_look_notify_tags_ison = NULL;
 struct t_config_option *irc_config_look_notify_tags_whois = NULL;
+struct t_config_option *irc_config_look_open_pv_buffer_echo_msg = NULL;
 struct t_config_option *irc_config_look_part_closes_buffer = NULL;
 struct t_config_option *irc_config_look_pv_buffer = NULL;
 struct t_config_option *irc_config_look_pv_tags = NULL;
@@ -3266,6 +3267,13 @@ irc_config_init ()
                "\"notify_highlight\""),
             NULL, 0, 0, "notify_message", NULL, 0,
             NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+        irc_config_look_open_pv_buffer_echo_msg = weechat_config_new_option (
+            irc_config_file, irc_config_section_look,
+            "open_pv_buffer_echo_msg", "boolean",
+            N_("open a private buffer on self message when capability "
+               "echo-message is enabled"),
+            NULL, 0, 0, "on", NULL, 0,
+            NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
         irc_config_look_part_closes_buffer = weechat_config_new_option (
             irc_config_file, irc_config_section_look,
             "part_closes_buffer", "boolean",
index 51f845f1911880de1337cc1a49131ff6f3c00c9f..a35b3240ef2142907acc20dc8985777f954d0fa3 100644 (file)
@@ -139,6 +139,7 @@ extern struct t_config_option *irc_config_look_notice_welcome_redirect;
 extern struct t_config_option *irc_config_look_notice_welcome_tags;
 extern struct t_config_option *irc_config_look_notify_tags_ison;
 extern struct t_config_option *irc_config_look_notify_tags_whois;
+extern struct t_config_option *irc_config_look_open_pv_buffer_echo_msg;
 extern struct t_config_option *irc_config_look_part_closes_buffer;
 extern struct t_config_option *irc_config_look_pv_buffer;
 extern struct t_config_option *irc_config_look_pv_tags;
index 11a6717dde98c9f9ed3fa75616fd69e536001847..dd687d7f60390cca7a88097c2d9ebfcb9bb31ba2 100644 (file)
@@ -3232,7 +3232,8 @@ IRC_PROTOCOL_CALLBACK(privmsg)
             if (strcmp (ptr_channel->name, remote_nick) != 0)
                 irc_channel_pv_rename (server, ptr_channel, remote_nick);
         }
-        else if (!nick_is_me || !cap_echo_message)
+        else if (!nick_is_me || !cap_echo_message
+                 || weechat_config_boolean (irc_config_look_open_pv_buffer_echo_msg))
         {
             ptr_channel = irc_channel_new (server,
                                            IRC_CHANNEL_TYPE_PRIVATE,
index a8c0b4297d68f1860705efd319e1d74ad29b0ba7..0bdd76d546caef42c754d6dcdd5f0d9bc025bd3e 100644 (file)
@@ -2798,9 +2798,17 @@ TEST(IrcProtocolWithServer, privmsg)
         {
             /* with echo-message */
             RECV(":alice!user@host PRIVMSG bob :this is the message ");
+            CHECK_PV_CLOSE("bob", "alice", "this is the message ",
+                           "irc_privmsg,self_msg,notify_none,no_highlight,"
+                           "prefix_nick_white,nick_alice,host_user@host,log1");
+            /* with echo-message, option irc.look.open_pv_buffer_echo_msg off */
+            config_file_option_set (irc_config_look_open_pv_buffer_echo_msg,
+                                    "off", 1);
+            RECV(":alice!user@host PRIVMSG bob :this is the message ");
             CHECK_SRV("--", "Msg(alice) -> bob: this is the message ",
                       "irc_privmsg,self_msg,notify_none,no_highlight,"
                       "nick_alice,host_user@host,log1");
+            config_file_option_reset (irc_config_look_open_pv_buffer_echo_msg, 1);
         }
 
         /*
@@ -2819,9 +2827,17 @@ TEST(IrcProtocolWithServer, privmsg)
         {
             /* with echo-message */
             RECV(":alice!user@host PRIVMSG nickserv :identify secret");
+            CHECK_PV_CLOSE("nickserv", "alice", "identify ******",
+                           "irc_privmsg,self_msg,notify_none,no_highlight,"
+                           "prefix_nick_white,nick_alice,host_user@host,log1");
+            /* with echo-message, option irc.look.open_pv_buffer_echo_msg off */
+            config_file_option_set (irc_config_look_open_pv_buffer_echo_msg,
+                                    "off", 1);
+            RECV(":alice!user@host PRIVMSG nickserv :identify secret");
             CHECK_SRV("--", "Msg(alice) -> nickserv: identify ******",
                       "irc_privmsg,self_msg,notify_none,no_highlight,"
                       "nick_alice,host_user@host,log1");
+            config_file_option_reset (irc_config_look_open_pv_buffer_echo_msg, 1);
         }
 
         /* broken CTCP to channel */