aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan Huber <rhuber@gmail.com>2016-09-28 12:01:32 -0700
committerGitHub <noreply@github.com>2016-09-28 12:01:32 -0700
commitaf0981b2dc0e8da9f3abe577eee615b361cc4a08 (patch)
tree2a74e95563c8b0be62dbb33f92565df8f3418333
parent384dbbe73e96098ff4f7cc3a10c307b266f17ff5 (diff)
parent7f9b731542913418b8bfea00c4feec6514735bba (diff)
downloadwee-slack-af0981b2dc0e8da9f3abe577eee615b361cc4a08.tar.gz
Merge pull request #260 from rawdigits/remove_distracting_channels_if_dont_exist
stop trying to hide channels that no longer exist
-rw-r--r--wee_slack.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/wee_slack.py b/wee_slack.py
index 4c6d989..f07d36c 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -1217,7 +1217,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):
@@ -1231,10 +1233,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):
"""