diff options
author | Ryan Huber <rhuber@gmail.com> | 2017-02-06 19:48:14 -0800 |
---|---|---|
committer | Ryan Huber <rhuber@gmail.com> | 2017-02-06 19:48:14 -0800 |
commit | abb2a995bffadee33a15cdcf5438afa2be0d0d9a (patch) | |
tree | 5a8a9a2ab2fc94d8d3fbba961e2fd393bda795ba | |
parent | e3c0b42889fabc53d30e9f5ba1b7bbae635d43b8 (diff) | |
download | wee-slack-abb2a995bffadee33a15cdcf5438afa2be0d0d9a.tar.gz |
hide channels only if they are in 'distracting' already
-rw-r--r-- | wee_slack.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/wee_slack.py b/wee_slack.py index 4b83afb..3ff3b04 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -2386,8 +2386,12 @@ def rehistory_command_callback(data, current_buffer, args): channel.get_history() def hide_command_callback(data, current_buffer, args): - current = w.current_buffer() - w.buffer_set(current, "hidden", str(int(hide_distractions))) + c = EVENTROUTER.weechat_controller.buffers.get(current_buffer, None) + if c: + name = c.formatted_name(style='long_default') + if name in config.distracting_channels: + w.buffer_set(c.channel_buffer, "hidden", "1") + return w.WEECHAT_RC_OK_EAT def slack_command_cb(data, current_buffer, args): a = args.split(' ', 1) |