diff options
author | Ryan Huber <rhuber@gmail.com> | 2017-02-04 21:10:07 -0800 |
---|---|---|
committer | Ryan Huber <rhuber@gmail.com> | 2017-02-04 21:10:07 -0800 |
commit | 0e17aed54659008daad66dacc379213ddf1d0bb0 (patch) | |
tree | 97f6a8c9f7055952106e69a2e0ec8defe52d0b2b /wee_slack.py | |
parent | 55e760cdedb2c57311883a6e38bc84404f249db5 (diff) | |
download | wee-slack-0e17aed54659008daad66dacc379213ddf1d0bb0.tar.gz |
allow tmp mute
Diffstat (limited to 'wee_slack.py')
-rw-r--r-- | wee_slack.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/wee_slack.py b/wee_slack.py index eee977a..01876bf 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -684,7 +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(',')] + 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() @@ -2029,6 +2029,19 @@ def command_talk(current_buffer, args): w.buffer_set(chan.channel_buffer, "display", "1") return True +def command_tmpmute(current_buffer, args): + current = w.current_buffer() + channel_id = EVENTROUTER.weechat_controller.buffers[current].identifier + team = EVENTROUTER.weechat_controller.buffers[current].team + if channel_id not in team.muted_channels: + team.muted_channels.add(channel_id) + else: + team.muted_channels.discard(channel_id) + +def command_showmuted(current_buffer, args): + current = w.current_buffer() + w.prnt(EVENTROUTER.weechat_controller.buffers[current].team.channel_buffer, str(EVENTROUTER.weechat_controller.buffers[current].team.muted_channels)) + def thread_command_callback(data, current_buffer, args): current = w.current_buffer() channel = EVENTROUTER.weechat_controller.buffers[current] |