aboutsummaryrefslogtreecommitdiffstats
path: root/activity_bar.pl
diff options
context:
space:
mode:
authorTeddy Wing2023-12-12 20:11:50 +0100
committerTeddy Wing2023-12-12 20:11:50 +0100
commit2baff3c74a078443058828e4a01a32fbec9285b5 (patch)
treeb8c5417ccf684344f27ddce7f7a2c768d78a2866 /activity_bar.pl
parentb7534281fe1077ad3afeba047d122643be5dd4ad (diff)
downloadweechat-activity-bar-2baff3c74a078443058828e4a01a32fbec9285b5.tar.bz2
activity_bar.pl: Don't show activity for messages below notify level
If a message comes in on a buffer whose notify level is set to highlights and higher, then don't update AnyBar activity. We should only be changing the AnyBar colour when we receive messages that we want to be notified of based on our configuration.
Diffstat (limited to 'activity_bar.pl')
-rw-r--r--activity_bar.pl5
1 files changed, 4 insertions, 1 deletions
diff --git a/activity_bar.pl b/activity_bar.pl
index c3f52cb..fdb02f8 100644
--- a/activity_bar.pl
+++ b/activity_bar.pl
@@ -72,6 +72,7 @@ sub print_cb {
my ($data, $buffer, $date, $tags, $displayed, $highlight, $prefix, $message) = @_;
my $buffer_type = weechat::buffer_get_string($buffer, 'localvar_type');
+ my $buffer_notify = weechat::buffer_get_integer($buffer, 'notify');
if ($buffer_type eq 'private') {
anybar_send('blue');
@@ -79,7 +80,9 @@ sub print_cb {
elsif ($highlight == 1) {
anybar_send('purple');
}
- else {
+
+ # Notify about regular messages if the buffer's `notify` property allows it.
+ elsif ($buffer_notify > 1) {
anybar_send('orange');
}