From 55e760cdedb2c57311883a6e38bc84404f249db5 Mon Sep 17 00:00:00 2001 From: Ryan Huber Date: Sat, 4 Feb 2017 20:54:06 -0800 Subject: don't show muted channel actvity when hidden --- wee_slack.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'wee_slack.py') diff --git a/wee_slack.py b/wee_slack.py index fcc835b..eee977a 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -664,7 +664,7 @@ class SlackTeam(object): incomplete Team object under which users and channels live.. Does lots. """ - def __init__(self, eventrouter, token, subdomain, nick, myidentifier, users, bots, channels): + def __init__(self, eventrouter, token, subdomain, nick, myidentifier, users, bots, channels, **kwargs): self.state = "disconnected" self.ws = None self.ws_counter = 0 @@ -684,6 +684,7 @@ class SlackTeam(object): self.channel_buffer = None self.got_history = True self.create_buffer() + self.muted_channels = [x for x in kwargs.get('muted_channels', []).split(',')] for c in self.channels.keys(): channels[c].set_related_server(self) channels[c].check_should_open() @@ -902,7 +903,7 @@ class SlackChannel(object): tags = tag("default") self.new_messages = True - if config.unhide_buffers_with_activity and not self.is_visible(): + if config.unhide_buffers_with_activity and not self.is_visible() and (self.identifier not in self.team.muted_channels): w.buffer_set(self.channel_buffer, "hidden", "0") w.prnt_date_tags(self.channel_buffer, ts.major, tags, data) @@ -1448,6 +1449,7 @@ def handle_rtmstart(login_data, eventrouter): users, bots, channels, + muted_channels=login_data["self"]["prefs"]["muted_channels"], ) eventrouter.register_team(t) -- cgit