From 2a2428902b021d6ea3535cc7b9700c3243879790 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sat, 23 Apr 2022 14:15:41 +0200 Subject: [PATCH] trigger: check that buffer notify is not "none" to run command of default trigger beep --- ChangeLog.adoc | 1 + ReleaseNotes.adoc | 15 +++++++++++++++ src/plugins/trigger/trigger-config.c | 8 ++++++-- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/ChangeLog.adoc b/ChangeLog.adoc index 132004391..ce5af848c 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -28,6 +28,7 @@ Bug fixes:: * core: fix bad window size on startup with some terminals like https://github.com/kovidgoyal/kitty[kitty] (issue #1769) * buflist: fix memory leak when reading config and changing option buflist.look.sort * relay: fix save of channels in autojoin option when JOIN and PART commands are received from an IRC relay client (issue #1771) + * trigger: add `${buffer.notify} > 0` in conditions of default trigger "beep" [[v3.5]] == Version 3.5 (2022-03-27) diff --git a/ReleaseNotes.adoc b/ReleaseNotes.adoc index a8d08c79b..ccbf9acaa 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.6]] +== Version 3.6 (under dev) + +[[v3.6_trigger_beep]] +=== Default trigger "beep" + +The command of "beep" trigger is now executed only if the buffer notify is NOT +set to `none` (in addition to existing conditions). + +You can restore the default trigger "beep" with the following command: + +---- +/trigger restore beep +---- + [[v3.5]] == Version 3.5 (2022-03-27) diff --git a/src/plugins/trigger/trigger-config.c b/src/plugins/trigger/trigger-config.c index 3f72a54f5..b29349526 100644 --- a/src/plugins/trigger/trigger-config.c +++ b/src/plugins/trigger/trigger-config.c @@ -59,12 +59,16 @@ char *trigger_config_default_list[][1 + TRIGGER_NUM_OPTIONS] = * - message is a highlight * OR: * - message is a message in a private buffer + * AND: + * - buffer notify is NOT "none" */ { "beep", "on", "print", "", - "${tg_displayed} && ${tg_tags} !!- ,notify_none, " - "&& (${tg_highlight} || ${tg_msg_pv})", + "${tg_displayed} " + "&& ${tg_tags} !!- ,notify_none, " + "&& (${tg_highlight} || ${tg_msg_pv}) " + "&& ${buffer.notify} > 0", "", "/print -beep", "ok",