aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
diff options
context:
space:
mode:
authorRyan Huber <rhuber@gmail.com>2016-09-28 09:24:51 -0700
committerRyan Huber <rhuber@gmail.com>2016-09-28 09:24:51 -0700
commit7f9b731542913418b8bfea00c4feec6514735bba (patch)
tree3bef67348e8a36cc256672e3d771af7187090ad0 /wee_slack.py
parente561bc54d36d897d6c46e328141100d8ee80a1b4 (diff)
downloadwee-slack-7f9b731542913418b8bfea00c4feec6514735bba.tar.gz
stop trying to hide channels that no longer exist
Diffstat (limited to 'wee_slack.py')
-rw-r--r--wee_slack.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/wee_slack.py b/wee_slack.py
index 68c8284..220265b 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -1205,7 +1205,9 @@ def command_nodistractions(current_buffer, args):
if channel_buffer:
w.buffer_set(channels.find(channel).channel_buffer, "hidden", str(int(hide_distractions)))
except:
- dbg("Can't hide channel {}".format(channel), main_buffer=True)
+ dbg("Can't hide channel {} .. removing..".format(channel), main_buffer=True)
+ distracting_channels.pop(distracting_channels.index(channel))
+ save_distracting_channels()
def command_distracting(current_buffer, args):
@@ -1219,10 +1221,15 @@ def command_distracting(current_buffer, args):
distracting_channels.append(fullname)
else:
distracting_channels.pop(distracting_channels.index(fullname))
+ save_distracting_channels()
+
+
+def save_distracting_channels():
new = ','.join(distracting_channels)
w.config_set_plugin('distracting_channels', new)
+
@slack_buffer_required
def command_users(current_buffer, args):
"""