From 619686d4ac458a0beeafa565bd4b0627526d9223 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Fri, 2 Feb 2024 19:42:14 +0100 Subject: activity_bar.pl: Fix notification for messages in "core.weechat" buffer It was possible to be highlighted in the core.weechat buffer, and that would trigger an AnyBar message and colour change. We don't want that to happen, so move the 'core.weechat' check earlier to completely ignore it. --- activity_bar.pl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/activity_bar.pl b/activity_bar.pl index 602012b..581bed4 100644 --- a/activity_bar.pl +++ b/activity_bar.pl @@ -86,6 +86,11 @@ sub print_cb { my $buffer_notify = weechat::buffer_get_integer($buffer, 'notify'); my $buffer_full_name = weechat::buffer_get_string($buffer, 'full_name'); + # Don't notify about messages in the WeeChat core buffer. + if ($buffer_full_name eq 'core.weechat') { + return weechat::WEECHAT_RC_OK; + } + if ($buffer_type eq 'private') { anybar_send('orange'); } @@ -94,11 +99,8 @@ sub print_cb { } # Notify about regular messages if the buffer's `notify` property allows - # it. Don't notify about messages in the WeeChat core buffer. - elsif ( - $buffer_notify > 1 - && $buffer_full_name ne 'core.weechat' - ) { + # it. + elsif ($buffer_notify > 1) { anybar_send('blue'); } -- cgit v1.2.3