aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2020-06-24 16:49:58 +0200
committerTrygve Aaberge <trygveaa@gmail.com>2020-06-24 16:52:28 +0200
commita9b29de170080d0971543b6afa42bbb08c3bf971 (patch)
tree977d21b08e7c59c940afd9cea9fdf1f21d5b125c
parentd9bbb8d735b089a5d5c5548668ce97c9c088b600 (diff)
downloadwee-slack-a9b29de170080d0971543b6afa42bbb08c3bf971.tar.gz
Remove buffer notify option for unmuted buffers
We were setting the notify level for unmuted buffers to 3. This is not the right thing to do because weechat has a weechat.look.buffer_notify_default option which might be set to a different value. By removing the option instead, weechat will use the default value. Additionally, when we change the notify level for a buffer, this is stored in the config (for weechat >= 2.6). Having such a config for all buffers is annoying, but with this change the config will only be present for muted buffers. This fix is not perfect because you still get config values for muted buffers, and since wee-slack is overriding the notify level you can't override it yourself for specific buffers. A potential solution to this could be to set notify level for each line instead of setting notify level for the buffer. Fixes #746
-rw-r--r--wee_slack.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/wee_slack.py b/wee_slack.py
index d20c29b..45804c7 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -1939,7 +1939,8 @@ class SlackChannel(SlackChannelCommon):
notify_level = "0" if config.muted_channels_activity == "none" else "1"
w.buffer_set(self.channel_buffer, "notify", notify_level)
else:
- w.buffer_set(self.channel_buffer, "notify", "3")
+ buffer_full_name = w.buffer_get_string(self.channel_buffer, "full_name")
+ w.command(self.channel_buffer, "/mute /unset weechat.notify.{}".format(buffer_full_name))
if self.muted and config.muted_channels_activity == "none":
w.buffer_set(self.channel_buffer, "highlight_tags_restrict", "highlight_force")