From e0e905ca7fe5b1fd43b96538378204da6a4840e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Mon, 20 Jul 2020 21:08:59 +0200 Subject: [PATCH] trigger: check that tag "notify_none" is not present in message to run command of default trigger beep (issue #1529) --- ChangeLog.adoc | 1 + ReleaseNotes.adoc | 15 +++++++++++++++ src/plugins/trigger/trigger-config.c | 5 ++++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/ChangeLog.adoc b/ChangeLog.adoc index 451c187a6..99d8b75f8 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -21,6 +21,7 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] Bug fixes:: * core: do not add line with highlight and tag "notify_none" to hotlist (issue #1529) + * trigger: add `${tg_tags} !!- ,notify_none,` in conditions of default trigger "beep" (issue #1529) [[v2.9]] == Version 2.9 (2020-07-18) diff --git a/ReleaseNotes.adoc b/ReleaseNotes.adoc index 3098e37d2..977f50939 100644 --- a/ReleaseNotes.adoc +++ b/ReleaseNotes.adoc @@ -17,6 +17,21 @@ https://weechat.org/files/changelog/ChangeLog-devel.html[ChangeLog] (file _ChangeLog.adoc_ in sources). +[[v3.0]] +== Version 3.0 (under dev) + +[[v3.0_trigger_beep]] +=== Default "beep" trigger + +The command of "beep" trigger is now executed only if the message does NOT +contain the tag "notify_none" (in addition to existing conditions). + +You can restore the default "beep" trigger with the following command: + +---- +/trigger restore beep +---- + [[v2.9]] == Version 2.9 (2020-07-18) diff --git a/src/plugins/trigger/trigger-config.c b/src/plugins/trigger/trigger-config.c index 83dcaa327..2bd8e3ca7 100644 --- a/src/plugins/trigger/trigger-config.c +++ b/src/plugins/trigger/trigger-config.c @@ -54,6 +54,8 @@ char *trigger_config_default_list[][1 + TRIGGER_NUM_OPTIONS] = * beep on highlight/private message, on following conditions: * - message is displayed (not filtered) * AND: + * - message does not have tag "notify_none" + * AND: * - message is a highlight * OR: * - message is a message in a private buffer @@ -61,7 +63,8 @@ char *trigger_config_default_list[][1 + TRIGGER_NUM_OPTIONS] = { "beep", "on", "print", "", - "${tg_displayed} && (${tg_highlight} || ${tg_msg_pv})", + "${tg_displayed} && ${tg_tags} !!- ,notify_none, " + "&& (${tg_highlight} || ${tg_msg_pv})", "", "/print -beep", "ok",