From 24ad703676fd03077d7b943f11a942e61da694e0 Mon Sep 17 00:00:00 2001 From: Trygve Aaberge Date: Sun, 2 Sep 2018 21:25:48 +0200 Subject: Always call set_highlights in set_highlight_words If highlight_words is set to nothing, we should still call set_highlights to remove any previous words. --- wee_slack.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/wee_slack.py b/wee_slack.py index 605456c..830d1cc 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -1102,10 +1102,9 @@ class SlackTeam(object): self.muted_channels = {x for x in muted_str.split(',') if x} def set_highlight_words(self, highlight_str): - self.highlight_words = {x for x in highlight_str.split(',')} - if len(self.highlight_words) > 0: - for v in self.channels.itervalues(): - v.set_highlights() + self.highlight_words = {x for x in highlight_str.split(',') if x} + for channel in self.channels.itervalues(): + channel.set_highlights() def formatted_name(self, **kwargs): return self.domain -- cgit