diff options
author | Ryan Huber <rhuber@gmail.com> | 2017-02-04 20:54:06 -0800 |
---|---|---|
committer | Ryan Huber <rhuber@gmail.com> | 2017-02-04 20:54:06 -0800 |
commit | 55e760cdedb2c57311883a6e38bc84404f249db5 (patch) | |
tree | 2470a2f18a778512a3324659e0228c30559bbcd0 /wee_slack.py | |
parent | 381da055cdfd7156815663471625be9254c70458 (diff) | |
download | wee-slack-55e760cdedb2c57311883a6e38bc84404f249db5.tar.gz |
don't show muted channel actvity when hidden
Diffstat (limited to 'wee_slack.py')
-rw-r--r-- | wee_slack.py | 6 |
1 files changed, 4 insertions, 2 deletions
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) |