diff options
author | Teddy Wing | 2024-02-02 19:42:14 +0100 |
---|---|---|
committer | Teddy Wing | 2024-02-02 19:42:14 +0100 |
commit | 619686d4ac458a0beeafa565bd4b0627526d9223 (patch) | |
tree | 2bd7a0c05708fd8f8859dcfef145734fe9bd9d8a | |
parent | 4ce8cee35973182eb1f905b2e93b44b660c655f6 (diff) | |
download | weechat-activity-bar-619686d4ac458a0beeafa565bd4b0627526d9223.tar.bz2 |
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.
-rw-r--r-- | activity_bar.pl | 12 |
1 files 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'); } |